From d15c32cc8c7c01f6f5bb7b25fa1c85cb1a04ce1b Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Sun, 12 Sep 2021 17:16:47 +0200 Subject: [PATCH] BIG-36: fix close drawer when delete Manual journals. --- .../Alerts/ManualJournals/JournalDeleteAlert.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/client/src/containers/Alerts/ManualJournals/JournalDeleteAlert.js b/client/src/containers/Alerts/ManualJournals/JournalDeleteAlert.js index 155506589..e0d4d9d7b 100644 --- a/client/src/containers/Alerts/ManualJournals/JournalDeleteAlert.js +++ b/client/src/containers/Alerts/ManualJournals/JournalDeleteAlert.js @@ -8,6 +8,7 @@ import { AppToaster } from 'components'; import withAlertActions from 'containers/Alert/withAlertActions'; import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect'; +import withDrawerActions from 'containers/Drawer/withDrawerActions'; import { compose } from 'utils'; @@ -23,8 +24,10 @@ function JournalDeleteAlert({ // #withAlertActions closeAlert, + + // #withDrawerActions + closeDrawer, }) { - const { mutateAsync: deleteJournalMutate, isLoading } = useDeleteJournal(); // Handle cancel delete manual journal. @@ -37,13 +40,13 @@ function JournalDeleteAlert({ deleteJournalMutate(manualJournalId) .then(() => { AppToaster.show({ - message: intl.get( - 'the_journal_has_been_deleted_successfully', - { number: journalNumber }, - ), + message: intl.get('the_journal_has_been_deleted_successfully', { + number: journalNumber, + }), intent: Intent.SUCCESS, }); closeAlert(name); + closeDrawer('journal-drawer'); }) .catch(() => { closeAlert(name); @@ -71,4 +74,5 @@ function JournalDeleteAlert({ export default compose( withAlertStoreConnect(), withAlertActions, + withDrawerActions )(JournalDeleteAlert);