mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-31 05:31:10 -04:00 
			
		
		
		
	refactor dashboard actions and send email actions
This commit is contained in:
		| @ -397,9 +397,15 @@ export default { | ||||
|           } | ||||
|           let response = await this.sendEmail(data) | ||||
|           this.refreshTable() | ||||
|           if (response.data) { | ||||
|           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')) | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
| @ -505,6 +511,7 @@ export default { | ||||
|  | ||||
|           if (res.data.success) { | ||||
|             window.toastr['success'](this.$tc('invoices.deleted_message')) | ||||
|             this.$refs.table.refresh() | ||||
|             return true | ||||
|           } | ||||
|  | ||||
|  | ||||
| @ -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')) | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user