refactor dashboard actions and send email actions

This commit is contained in:
Jay_Makwana
2019-11-18 19:41:31 +05:30
parent 4a8ac36b3a
commit 94d48c76b8
12 changed files with 93 additions and 130 deletions

View File

@ -260,9 +260,15 @@ export default {
this.isSendingEmail = true
let response = await this.sendEmail({id: this.invoice.id})
this.isSendingEmail = false
if (response.data) {
window.toastr['success'](this.$tc('invoices.confirm_send_invoice'))
if (response.data.success) {
window.toastr['success'](this.$tc('invoices.send_invoice_successfully'))
return true
}
if (response.data.error === 'user_email_does_not_exist') {
window.toastr['error'](this.$tc('invoices.user_email_does_not_exist'))
return false
}
window.toastr['error'](this.$tc('invoices.something_went_wrong'))
}
})
},