From 7170fb0cef84fb94a3b7a99279da9fd0bc292fcf Mon Sep 17 00:00:00 2001 From: asift798 Date: Wed, 16 Feb 2022 18:59:49 +0530 Subject: [PATCH] fix send invoices and payments issues --- .../admin/components/modal-components/SendInvoiceModal.vue | 2 ++ .../admin/components/modal-components/SendPaymentModal.vue | 2 ++ resources/scripts/admin/stores/payment.js | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/scripts/admin/components/modal-components/SendInvoiceModal.vue b/resources/scripts/admin/components/modal-components/SendInvoiceModal.vue index 9ee1f8daa..799a35326 100644 --- a/resources/scripts/admin/components/modal-components/SendInvoiceModal.vue +++ b/resources/scripts/admin/components/modal-components/SendInvoiceModal.vue @@ -260,6 +260,8 @@ async function submitForm() { const response = await invoiceStore.sendInvoice(invoiceMailForm) + isLoading.value = false + if (response.data.success) { closeSendInvoiceModal() return true diff --git a/resources/scripts/admin/components/modal-components/SendPaymentModal.vue b/resources/scripts/admin/components/modal-components/SendPaymentModal.vue index 8eb39c094..6c786312b 100644 --- a/resources/scripts/admin/components/modal-components/SendPaymentModal.vue +++ b/resources/scripts/admin/components/modal-components/SendPaymentModal.vue @@ -257,6 +257,8 @@ async function sendPaymentData() { const response = await paymentStore.sendEmail(paymentMailForm) + isLoading.value = false + if (response.data.success) { closeSendPaymentModal() return true diff --git a/resources/scripts/admin/stores/payment.js b/resources/scripts/admin/stores/payment.js index a134db640..b6fb0fb20 100644 --- a/resources/scripts/admin/stores/payment.js +++ b/resources/scripts/admin/stores/payment.js @@ -93,7 +93,6 @@ export const usePaymentStore = (useWindow = false) => { }) }, - fetchPayments(params) { return new Promise((resolve, reject) => { axios @@ -289,6 +288,11 @@ export const usePaymentStore = (useWindow = false) => { axios .post(`/api/v1/payments/${data.id}/send`, data) .then((response) => { + const notificationStore = useNotificationStore() + notificationStore.showNotification({ + type: 'success', + message: global.t('payments.send_payment_successfully'), + }) resolve(response) }) .catch((err) => {