mirror of
https://github.com/crater-invoice/crater.git
synced 2025-12-17 10:52:55 -05:00
Add New SweetAlert & Notification Components
This commit is contained in:
committed by
Mohit Panjwani
parent
3f7db2793f
commit
c3d3e5e35f
@@ -251,6 +251,7 @@ export default {
|
||||
...mapActions('modal', ['closeModal', 'resetModalData']),
|
||||
...mapActions('item', ['addItem', 'updateItem', 'fetchItemUnits']),
|
||||
...mapActions('invoice', ['setItem']),
|
||||
...mapActions('notification', ['showNotification']),
|
||||
|
||||
resetFormData() {
|
||||
this.formData = {
|
||||
@@ -304,7 +305,10 @@ export default {
|
||||
response = await this.addItem(data)
|
||||
}
|
||||
if (response.data) {
|
||||
window.toastr['success'](this.$tc('items.created_message'))
|
||||
this.showNotification({
|
||||
type: 'success',
|
||||
message: this.$tc('items.created_message'),
|
||||
})
|
||||
this.setItem(response.data.item)
|
||||
|
||||
window.hub.$emit('newItem', response.data.item)
|
||||
@@ -314,7 +318,10 @@ export default {
|
||||
this.closeModal()
|
||||
return true
|
||||
}
|
||||
window.toastr['error'](response.data.error)
|
||||
this.showNotification({
|
||||
type: 'error',
|
||||
message: response.data.error,
|
||||
})
|
||||
},
|
||||
|
||||
closeItemModal() {
|
||||
|
||||
Reference in New Issue
Block a user