mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
Add New SweetAlert & Notification Components
This commit is contained in:
committed by
Mohit Panjwani
parent
3f7db2793f
commit
c3d3e5e35f
@ -722,6 +722,8 @@ export default {
|
||||
|
||||
...mapActions('customFields', ['fetchCustomFields']),
|
||||
|
||||
...mapActions('notification', ['showNotification']),
|
||||
|
||||
selectFixed() {
|
||||
if (this.newInvoice.discount_type === 'fixed') {
|
||||
return
|
||||
@ -918,8 +920,10 @@ export default {
|
||||
.then((res) => {
|
||||
if (res.data) {
|
||||
this.$router.push(`/admin/invoices/${res.data.invoice.id}/view`)
|
||||
|
||||
window.toastr['success'](this.$t('invoices.created_message'))
|
||||
this.showNotification({
|
||||
type: 'success',
|
||||
message: this.$t('invoices.created_message'),
|
||||
})
|
||||
}
|
||||
|
||||
this.isLoading = false
|
||||
@ -935,13 +939,17 @@ export default {
|
||||
this.isLoading = false
|
||||
if (res.data.success) {
|
||||
this.$router.push(`/admin/invoices/${res.data.invoice.id}/view`)
|
||||
window.toastr['success'](this.$t('invoices.updated_message'))
|
||||
this.showNotification({
|
||||
type: 'success',
|
||||
message: this.$t('invoices.updated_message'),
|
||||
})
|
||||
}
|
||||
|
||||
if (res.data.error === 'invalid_due_amount') {
|
||||
window.toastr['error'](
|
||||
this.$t('invoices.invalid_due_amount_message')
|
||||
)
|
||||
this.showNotification({
|
||||
type: 'error',
|
||||
message: this.$t('invoices.invalid_due_amount_message'),
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user