From 7ce15cda3c9d66dab809911c26134b184ab063ea Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Sun, 12 Sep 2021 15:45:56 +0200 Subject: [PATCH] BIG-28: fix close drawer when delete item. --- client/src/containers/Alerts/Items/ItemDeleteAlert.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/containers/Alerts/Items/ItemDeleteAlert.js b/client/src/containers/Alerts/Items/ItemDeleteAlert.js index 7a81baa5e..51e1ac638 100644 --- a/client/src/containers/Alerts/Items/ItemDeleteAlert.js +++ b/client/src/containers/Alerts/Items/ItemDeleteAlert.js @@ -1,6 +1,6 @@ import React from 'react'; import intl from 'react-intl-universal'; -import { FormattedMessage as T, FormattedHTMLMessage } from 'components'; +import { FormattedMessage as T, FormattedHTMLMessage } from 'components'; import { Intent, Alert } from '@blueprintjs/core'; import { AppToaster } from 'components'; @@ -10,6 +10,7 @@ import { useDeleteItem } from 'hooks/query'; import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect'; import withAlertActions from 'containers/Alert/withAlertActions'; import withItemsActions from 'containers/Items/withItemsActions'; +import withDrawerActions from 'containers/Drawer/withDrawerActions'; import { compose } from 'utils'; @@ -28,9 +29,11 @@ function ItemDeleteAlert({ // #withItemsActions setItemsTableState, + + // #withDrawerActions + closeDrawer, }) { const { mutateAsync: deleteItem, isLoading } = useDeleteItem(); - // Handle cancel delete item alert. const handleCancelItemDelete = () => { @@ -47,6 +50,7 @@ function ItemDeleteAlert({ }); // Reset to page number one. setItemsTableState({ page: 1 }); + closeDrawer('item-detail-drawer'); }) .catch( ({ @@ -86,4 +90,5 @@ export default compose( withAlertStoreConnect(), withAlertActions, withItemsActions, + withDrawerActions, )(ItemDeleteAlert);