mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
BIG-13: fix close drawer when delete.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import intl from 'react-intl-universal';
|
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 { Intent, Alert } from '@blueprintjs/core';
|
||||||
|
|
||||||
import { useDeletePaymentReceive } from 'hooks/query';
|
import { useDeletePaymentReceive } from 'hooks/query';
|
||||||
@@ -8,6 +8,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';
|
||||||
|
|
||||||
@@ -23,12 +24,12 @@ function PaymentReceiveDeleteAlert({
|
|||||||
|
|
||||||
// #withAlertActions
|
// #withAlertActions
|
||||||
closeAlert,
|
closeAlert,
|
||||||
}) {
|
|
||||||
|
|
||||||
const {
|
// #withDrawerActions
|
||||||
mutateAsync: deletePaymentReceiveMutate,
|
closeDrawer,
|
||||||
isLoading,
|
}) {
|
||||||
} = useDeletePaymentReceive();
|
const { mutateAsync: deletePaymentReceiveMutate, isLoading } =
|
||||||
|
useDeletePaymentReceive();
|
||||||
|
|
||||||
// Handle cancel payment Receive.
|
// Handle cancel payment Receive.
|
||||||
const handleCancelDeleteAlert = () => {
|
const handleCancelDeleteAlert = () => {
|
||||||
@@ -40,9 +41,12 @@ function PaymentReceiveDeleteAlert({
|
|||||||
deletePaymentReceiveMutate(paymentReceiveId)
|
deletePaymentReceiveMutate(paymentReceiveId)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
AppToaster.show({
|
AppToaster.show({
|
||||||
message: intl.get('the_payment_receive_has_been_deleted_successfully'),
|
message: intl.get(
|
||||||
|
'the_payment_receive_has_been_deleted_successfully',
|
||||||
|
),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
|
closeDrawer('payment-receive-detail-drawer');
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@@ -73,4 +77,5 @@ function PaymentReceiveDeleteAlert({
|
|||||||
export default compose(
|
export default compose(
|
||||||
withAlertStoreConnect(),
|
withAlertStoreConnect(),
|
||||||
withAlertActions,
|
withAlertActions,
|
||||||
|
withDrawerActions,
|
||||||
)(PaymentReceiveDeleteAlert);
|
)(PaymentReceiveDeleteAlert);
|
||||||
|
|||||||
Reference in New Issue
Block a user