mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
Add New SweetAlert & Notification Components
This commit is contained in:
committed by
Mohit Panjwani
parent
3f7db2793f
commit
c3d3e5e35f
@ -417,6 +417,8 @@ export default {
|
||||
|
||||
...mapActions('customer', ['fetchCustomers']),
|
||||
|
||||
...mapActions('notification', ['showNotification']),
|
||||
|
||||
openCategoryModal() {
|
||||
this.openModal({
|
||||
title: this.$t('settings.expense_category.add_category'),
|
||||
@ -532,22 +534,34 @@ export default {
|
||||
|
||||
if (response.data.success) {
|
||||
this.isLoading = false
|
||||
window.toastr['success'](this.$t('expenses.updated_message'))
|
||||
this.showNotification({
|
||||
type: 'success',
|
||||
message: this.$t('expenses.updated_message'),
|
||||
})
|
||||
this.$router.push('/admin/expenses')
|
||||
return true
|
||||
}
|
||||
window.toastr['error'](response.data.error)
|
||||
this.showNotification({
|
||||
type: 'error',
|
||||
message: response.data.error,
|
||||
})
|
||||
} else {
|
||||
this.isLoading = true
|
||||
let response = await this.addExpense(data)
|
||||
this.isLoading = false
|
||||
|
||||
if (response.data.success) {
|
||||
window.toastr['success'](this.$t('expenses.created_message'))
|
||||
this.showNotification({
|
||||
type: 'success',
|
||||
message: this.$t('expenses.created_message'),
|
||||
})
|
||||
this.$router.push('/admin/expenses')
|
||||
return true
|
||||
}
|
||||
window.toastr['success'](response.data.success)
|
||||
this.showNotification({
|
||||
type: 'success',
|
||||
message: response.data.success,
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user