From 39bfdd1ce53ad60503b2b7247b9f97c8b23811a3 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Sun, 12 Sep 2021 17:00:07 +0200 Subject: [PATCH] BIG-37: fix close drawer when delete payment made. --- .../Alerts/PaymentMades/PaymentMadeDeleteAlert.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/src/containers/Alerts/PaymentMades/PaymentMadeDeleteAlert.js b/client/src/containers/Alerts/PaymentMades/PaymentMadeDeleteAlert.js index 109cf3f3a..e90e628c2 100644 --- a/client/src/containers/Alerts/PaymentMades/PaymentMadeDeleteAlert.js +++ b/client/src/containers/Alerts/PaymentMades/PaymentMadeDeleteAlert.js @@ -6,6 +6,7 @@ import { AppToaster } from 'components'; import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect'; import withAlertActions from 'containers/Alert/withAlertActions'; +import withDrawerActions from 'containers/Drawer/withDrawerActions'; import { useDeletePaymentMade } from 'hooks/query'; @@ -23,12 +24,12 @@ function PaymentMadeDeleteAlert({ // #withAlertActions closeAlert, + + // #withDrawerActions + closeDrawer, }) { - - const { - mutateAsync: deletePaymentMadeMutate, - isLoading, - } = useDeletePaymentMade(); + const { mutateAsync: deletePaymentMadeMutate, isLoading } = + useDeletePaymentMade(); // Handle cancel payment made. const handleCancelPaymentMadeDelete = () => {}; @@ -41,6 +42,7 @@ function PaymentMadeDeleteAlert({ message: intl.get('the_payment_made_has_been_deleted_successfully'), intent: Intent.SUCCESS, }); + closeDrawer('payment-made-detail-drawer'); }) .finally(() => { closeAlert(name); @@ -68,4 +70,5 @@ function PaymentMadeDeleteAlert({ export default compose( withAlertStoreConnect(), withAlertActions, + withDrawerActions, )(PaymentMadeDeleteAlert);