mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
fix notification module issues
This commit is contained in:
@ -377,13 +377,13 @@ export default {
|
|||||||
if (result.value) {
|
if (result.value) {
|
||||||
let res = await this.deleteEstimate({ ids: [this.id] })
|
let res = await this.deleteEstimate({ ids: [this.id] })
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('estimates.deleted_message', 1),
|
message: this.$tc('estimates.deleted_message', 1),
|
||||||
})
|
})
|
||||||
this.refreshEstTable()
|
this.refreshEstTable()
|
||||||
} else if (res.data.error) {
|
} else if (res.data.error) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: res.data.message,
|
message: res.data.message,
|
||||||
})
|
})
|
||||||
@ -428,13 +428,13 @@ export default {
|
|||||||
this.selectAllField = false
|
this.selectAllField = false
|
||||||
|
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$t('estimates.conversion_message'),
|
message: this.$t('estimates.conversion_message'),
|
||||||
})
|
})
|
||||||
this.$router.push(`invoices/${res.data.invoice.id}/edit`)
|
this.$router.push(`invoices/${res.data.invoice.id}/edit`)
|
||||||
} else if (res.data.error) {
|
} else if (res.data.error) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: res.data.message,
|
message: res.data.message,
|
||||||
})
|
})
|
||||||
@ -477,7 +477,7 @@ export default {
|
|||||||
this.refreshEstTable()
|
this.refreshEstTable()
|
||||||
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('estimates.mark_as_sent_successfully'),
|
message: this.$tc('estimates.mark_as_sent_successfully'),
|
||||||
})
|
})
|
||||||
@ -502,13 +502,13 @@ export default {
|
|||||||
if (result.value) {
|
if (result.value) {
|
||||||
let res = await this.deleteInvoice({ ids: [this.id] })
|
let res = await this.deleteInvoice({ ids: [this.id] })
|
||||||
if (res.data.success) {
|
if (res.data.success) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('invoices.deleted_message'),
|
message: this.$tc('invoices.deleted_message'),
|
||||||
})
|
})
|
||||||
this.refreshInvTable()
|
this.refreshInvTable()
|
||||||
} else if (res.data.error) {
|
} else if (res.data.error) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: res.data.message,
|
message: res.data.message,
|
||||||
})
|
})
|
||||||
@ -549,7 +549,7 @@ export default {
|
|||||||
this.refreshInvTable()
|
this.refreshInvTable()
|
||||||
|
|
||||||
if (response.data.success) {
|
if (response.data.success) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('invoices.send_invoice_successfully'),
|
message: this.$tc('invoices.send_invoice_successfully'),
|
||||||
})
|
})
|
||||||
@ -557,13 +557,13 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (response.data.error === 'user_email_does_not_exist') {
|
if (response.data.error === 'user_email_does_not_exist') {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: this.$tc('invoices.user_email_does_not_exist'),
|
message: this.$tc('invoices.user_email_does_not_exist'),
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: this.$tc('invoices.something_went_wrong'),
|
message: this.$tc('invoices.something_went_wrong'),
|
||||||
})
|
})
|
||||||
@ -604,7 +604,7 @@ export default {
|
|||||||
|
|
||||||
this.refreshInvTable()
|
this.refreshInvTable()
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('invoices.mark_as_sent_successfully'),
|
message: this.$tc('invoices.mark_as_sent_successfully'),
|
||||||
})
|
})
|
||||||
@ -646,7 +646,7 @@ export default {
|
|||||||
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.refreshEstTable()
|
this.refreshEstTable()
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('estimates.marked_as_accepted_message'),
|
message: this.$tc('estimates.marked_as_accepted_message'),
|
||||||
})
|
})
|
||||||
@ -688,7 +688,7 @@ export default {
|
|||||||
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.refreshEstTable()
|
this.refreshEstTable()
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('estimates.marked_as_rejected_message'),
|
message: this.$tc('estimates.marked_as_rejected_message'),
|
||||||
})
|
})
|
||||||
@ -730,7 +730,7 @@ export default {
|
|||||||
this.refreshEstTable()
|
this.refreshEstTable()
|
||||||
|
|
||||||
if (response.data.success) {
|
if (response.data.success) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('estimates.send_estimate_successfully'),
|
message: this.$tc('estimates.send_estimate_successfully'),
|
||||||
})
|
})
|
||||||
@ -738,13 +738,13 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (response.data.error === 'user_email_does_not_exist') {
|
if (response.data.error === 'user_email_does_not_exist') {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: this.$tc('estimates.user_email_does_not_exist'),
|
message: this.$tc('estimates.user_email_does_not_exist'),
|
||||||
})
|
})
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: this.$tc('estimates.something_went_wrong'),
|
message: this.$tc('estimates.something_went_wrong'),
|
||||||
})
|
})
|
||||||
|
|||||||
@ -422,7 +422,7 @@ export default {
|
|||||||
this.isMarkAsSent = false
|
this.isMarkAsSent = false
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.estimate.status = 'SENT'
|
this.estimate.status = 'SENT'
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('estimates.mark_as_sent_successfully'),
|
message: this.$tc('estimates.mark_as_sent_successfully'),
|
||||||
})
|
})
|
||||||
@ -461,13 +461,13 @@ export default {
|
|||||||
if (result.value) {
|
if (result.value) {
|
||||||
let request = await this.deleteEstimate({ ids: [id] })
|
let request = await this.deleteEstimate({ ids: [id] })
|
||||||
if (request.data.success) {
|
if (request.data.success) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('estimates.deleted_message', 1),
|
message: this.$tc('estimates.deleted_message', 1),
|
||||||
})
|
})
|
||||||
this.$router.push('/admin/estimates')
|
this.$router.push('/admin/estimates')
|
||||||
} else if (request.data.error) {
|
} else if (request.data.error) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: request.data.message,
|
message: request.data.message,
|
||||||
})
|
})
|
||||||
|
|||||||
@ -426,7 +426,7 @@ export default {
|
|||||||
this.isMarkingAsSent = false
|
this.isMarkingAsSent = false
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
this.invoice.status = 'SENT'
|
this.invoice.status = 'SENT'
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('invoices.marked_as_sent_message'),
|
message: this.$tc('invoices.marked_as_sent_message'),
|
||||||
})
|
})
|
||||||
@ -465,13 +465,13 @@ export default {
|
|||||||
if (result.value) {
|
if (result.value) {
|
||||||
let request = await this.deleteInvoice({ ids: [id] })
|
let request = await this.deleteInvoice({ ids: [id] })
|
||||||
if (request.data.success) {
|
if (request.data.success) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('invoices.deleted_message', 1),
|
message: this.$tc('invoices.deleted_message', 1),
|
||||||
})
|
})
|
||||||
this.$router.push('/admin/invoices')
|
this.$router.push('/admin/invoices')
|
||||||
} else if (request.data.error) {
|
} else if (request.data.error) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: request.data.message,
|
message: request.data.message,
|
||||||
})
|
})
|
||||||
|
|||||||
@ -385,13 +385,13 @@ export default {
|
|||||||
if (result.value) {
|
if (result.value) {
|
||||||
let request = await this.deletePayment({ ids: [id] })
|
let request = await this.deletePayment({ ids: [id] })
|
||||||
if (request.data.success) {
|
if (request.data.success) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: this.$tc('payments.deleted_message', 1),
|
message: this.$tc('payments.deleted_message', 1),
|
||||||
})
|
})
|
||||||
this.$router.push('/admin/payments')
|
this.$router.push('/admin/payments')
|
||||||
} else if (request.data.error) {
|
} else if (request.data.error) {
|
||||||
this.showToaster({
|
this.showNotification({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: request.data.message,
|
message: request.data.message,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user