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
@ -24,7 +24,7 @@ import Smtp from './mail-driver/SmtpMailDriver'
|
||||
import Mailgun from './mail-driver/MailgunMailDriver'
|
||||
import Ses from './mail-driver/SesMailDriver'
|
||||
import Basic from './mail-driver/BasicMailDriver'
|
||||
|
||||
import { mapActions } from 'vuex'
|
||||
export default {
|
||||
components: {
|
||||
Smtp,
|
||||
@ -48,6 +48,7 @@ export default {
|
||||
this.getMailDrivers()
|
||||
},
|
||||
methods: {
|
||||
...mapActions('notification', ['showNotification']),
|
||||
async getMailDrivers() {
|
||||
this.isLoading = this.isFetching = true
|
||||
|
||||
@ -67,19 +68,24 @@ export default {
|
||||
)
|
||||
if (response.data.success) {
|
||||
this.$emit('next', 4)
|
||||
window.toastr['success'](
|
||||
this.$t('wizard.success.' + response.data.success)
|
||||
)
|
||||
this.showNotification({
|
||||
type: 'success',
|
||||
message: this.$t('wizard.success.' + response.data.success),
|
||||
})
|
||||
} else {
|
||||
window.toastr['error'](
|
||||
this.$t('wizard.errors.' + response.data.error)
|
||||
)
|
||||
this.showNotification({
|
||||
type: 'error',
|
||||
message: this.$t('wizard.errors.' + response.data.error),
|
||||
})
|
||||
}
|
||||
this.isLoading = this.isFetching = false
|
||||
return true
|
||||
} catch (e) {
|
||||
this.isLoading = this.isFetching = false
|
||||
window.toastr['error']('Something went wrong')
|
||||
this.showNotification({
|
||||
type: 'error',
|
||||
message: 'Something went wrong',
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user