diff --git a/src/containers/Alerts/Warehouses/WarehouseTransferDeleteAlert.js b/src/containers/Alerts/Warehouses/WarehouseTransferDeleteAlert.js index 936ccc97c..a602be329 100644 --- a/src/containers/Alerts/Warehouses/WarehouseTransferDeleteAlert.js +++ b/src/containers/Alerts/Warehouses/WarehouseTransferDeleteAlert.js @@ -7,6 +7,7 @@ import { useDeleteWarehouseTransfer } from 'hooks/query'; import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect'; import withAlertActions from 'containers/Alert/withAlertActions'; +import withDrawerActions from 'containers/Drawer/withDrawerActions'; import { compose } from 'utils'; @@ -23,9 +24,12 @@ function WarehouseTransferDeleteAlert({ // #withAlertActions closeAlert, + + // #withDrawerActions + closeDrawer, }) { const { mutateAsync: deleteWarehouseTransferMutate, isLoading } = - useDeleteWarehouseTransfer(); + useDeleteWarehouseTransfer(); // handle cancel delete warehouse alert. const handleCancelDeleteAlert = () => { @@ -40,6 +44,7 @@ function WarehouseTransferDeleteAlert({ message: intl.get('warehouse_transfer.alert.delete_message'), intent: Intent.SUCCESS, }); + closeDrawer('warehouse-transfer-detail-drawer'); }) .catch( ({ @@ -76,4 +81,5 @@ function WarehouseTransferDeleteAlert({ export default compose( withAlertStoreConnect(), withAlertActions, + withDrawerActions, )(WarehouseTransferDeleteAlert); diff --git a/src/containers/Drawers/WarehouseTransferDetailDrawer/WarehouseTransferDetailActionsBar.js b/src/containers/Drawers/WarehouseTransferDetailDrawer/WarehouseTransferDetailActionsBar.js index 9202666f4..9a443d5d8 100644 --- a/src/containers/Drawers/WarehouseTransferDetailDrawer/WarehouseTransferDetailActionsBar.js +++ b/src/containers/Drawers/WarehouseTransferDetailDrawer/WarehouseTransferDetailActionsBar.js @@ -34,15 +34,18 @@ function WarehouseTransferDetailActionsBar({ }) { const history = useHistory(); + const { warehouseTransferId, warehouseTransfer } = + useWarehouseDetailDrawerContext(); + // Handle edit warehosue transfer. const handleEditWarehosueTransfer = () => { - // history.push(`/warehouse-transfers/${warehouseTransferId}/edit`); + history.push(`/warehouses-transfers/${warehouseTransferId}/edit`); closeDrawer('warehouse-transfer-detail-drawer'); }; // Handle delete warehouse transfer. const handleDeletetWarehosueTransfer = () => { - // openAlert('warehouse-transfer-delete', { warehouseTransferId }); + openAlert('warehouse-transfer-delete', { warehouseTransferId }); }; return ( diff --git a/src/containers/Drawers/WarehouseTransferDetailDrawer/WarehouseTransferDetailDrawerProvider.js b/src/containers/Drawers/WarehouseTransferDetailDrawer/WarehouseTransferDetailDrawerProvider.js index b470c954f..d6b6572b6 100644 --- a/src/containers/Drawers/WarehouseTransferDetailDrawer/WarehouseTransferDetailDrawerProvider.js +++ b/src/containers/Drawers/WarehouseTransferDetailDrawer/WarehouseTransferDetailDrawerProvider.js @@ -28,7 +28,9 @@ function WarehouseTransferDetailDrawerProvider({ - +