mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 04:31:08 -04:00
Add New SweetAlert & Notification Components
This commit is contained in:
committed by
Mohit Panjwani
parent
3f7db2793f
commit
c3d3e5e35f
@ -312,6 +312,8 @@ export default {
|
||||
|
||||
...mapActions('modal', ['openModal']),
|
||||
|
||||
...mapActions('notification', ['showNotification']),
|
||||
|
||||
async setTaxPerItem() {
|
||||
let response = await this.fetchCompanySettings(['tax_per_item'])
|
||||
|
||||
@ -385,15 +387,24 @@ export default {
|
||||
this.isLoading = false
|
||||
|
||||
if (!this.isEdit) {
|
||||
window.toastr['success'](this.$tc('items.created_message'))
|
||||
this.showNotification({
|
||||
type: 'success',
|
||||
message: this.$tc('items.created_message'),
|
||||
})
|
||||
this.$router.push('/admin/items')
|
||||
return true
|
||||
} else {
|
||||
window.toastr['success'](this.$tc('items.updated_message'))
|
||||
this.showNotification({
|
||||
type: 'success',
|
||||
message: this.$tc('items.updated_message'),
|
||||
})
|
||||
this.$router.push('/admin/items')
|
||||
return true
|
||||
}
|
||||
window.toastr['error'](response.data.error)
|
||||
this.showNotification({
|
||||
type: 'error',
|
||||
message: response.data.error,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user