Add New SweetAlert & Notification Components

This commit is contained in:
Aman Upadhyay
2021-04-09 12:35:50 +00:00
committed by Mohit Panjwani
parent 3f7db2793f
commit c3d3e5e35f
78 changed files with 2295 additions and 984 deletions

View File

@ -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) => {