mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
BIG-31: fix close drawer when delete sale estimate.
This commit is contained in:
@@ -9,6 +9,7 @@ import { AppToaster } from 'components';
|
|||||||
|
|
||||||
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
||||||
import withAlertActions from 'containers/Alert/withAlertActions';
|
import withAlertActions from 'containers/Alert/withAlertActions';
|
||||||
|
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
@@ -24,8 +25,10 @@ function EstimateDeleteAlert({
|
|||||||
|
|
||||||
// #withAlertActions
|
// #withAlertActions
|
||||||
closeAlert,
|
closeAlert,
|
||||||
}) {
|
|
||||||
|
|
||||||
|
// #withDrawerActions
|
||||||
|
closeDrawer,
|
||||||
|
}) {
|
||||||
const { mutateAsync: deleteEstimateMutate, isLoading } = useDeleteEstimate();
|
const { mutateAsync: deleteEstimateMutate, isLoading } = useDeleteEstimate();
|
||||||
|
|
||||||
// handle cancel delete alert.
|
// handle cancel delete alert.
|
||||||
@@ -41,6 +44,7 @@ function EstimateDeleteAlert({
|
|||||||
message: intl.get('the_estimate_has_been_deleted_successfully'),
|
message: intl.get('the_estimate_has_been_deleted_successfully'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
|
closeDrawer('estimate-detail-drawer');
|
||||||
})
|
})
|
||||||
.catch(({ errors }) => {})
|
.catch(({ errors }) => {})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@@ -71,4 +75,5 @@ function EstimateDeleteAlert({
|
|||||||
export default compose(
|
export default compose(
|
||||||
withAlertStoreConnect(),
|
withAlertStoreConnect(),
|
||||||
withAlertActions,
|
withAlertActions,
|
||||||
|
withDrawerActions,
|
||||||
)(EstimateDeleteAlert);
|
)(EstimateDeleteAlert);
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ function EstimateDetailActionsBar({
|
|||||||
// Handle delete sale estimate.
|
// Handle delete sale estimate.
|
||||||
const handleDeleteEstimate = () => {
|
const handleDeleteEstimate = () => {
|
||||||
openAlert('estimate-delete', { estimateId });
|
openAlert('estimate-delete', { estimateId });
|
||||||
closeDrawer('estimate-detail-drawer');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle print estimate.
|
// Handle print estimate.
|
||||||
|
|||||||
Reference in New Issue
Block a user