mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 23:00:34 +00:00
BIG-36: fix close drawer when delete Manual journals.
This commit is contained in:
@@ -8,6 +8,7 @@ import { AppToaster } from 'components';
|
|||||||
|
|
||||||
import withAlertActions from 'containers/Alert/withAlertActions';
|
import withAlertActions from 'containers/Alert/withAlertActions';
|
||||||
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
|
||||||
|
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||||
|
|
||||||
import { compose } from 'utils';
|
import { compose } from 'utils';
|
||||||
|
|
||||||
@@ -23,8 +24,10 @@ function JournalDeleteAlert({
|
|||||||
|
|
||||||
// #withAlertActions
|
// #withAlertActions
|
||||||
closeAlert,
|
closeAlert,
|
||||||
}) {
|
|
||||||
|
|
||||||
|
// #withDrawerActions
|
||||||
|
closeDrawer,
|
||||||
|
}) {
|
||||||
const { mutateAsync: deleteJournalMutate, isLoading } = useDeleteJournal();
|
const { mutateAsync: deleteJournalMutate, isLoading } = useDeleteJournal();
|
||||||
|
|
||||||
// Handle cancel delete manual journal.
|
// Handle cancel delete manual journal.
|
||||||
@@ -37,13 +40,13 @@ function JournalDeleteAlert({
|
|||||||
deleteJournalMutate(manualJournalId)
|
deleteJournalMutate(manualJournalId)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
AppToaster.show({
|
AppToaster.show({
|
||||||
message: intl.get(
|
message: intl.get('the_journal_has_been_deleted_successfully', {
|
||||||
'the_journal_has_been_deleted_successfully',
|
number: journalNumber,
|
||||||
{ number: journalNumber },
|
}),
|
||||||
),
|
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeAlert(name);
|
closeAlert(name);
|
||||||
|
closeDrawer('journal-drawer');
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
closeAlert(name);
|
closeAlert(name);
|
||||||
@@ -71,4 +74,5 @@ function JournalDeleteAlert({
|
|||||||
export default compose(
|
export default compose(
|
||||||
withAlertStoreConnect(),
|
withAlertStoreConnect(),
|
||||||
withAlertActions,
|
withAlertActions,
|
||||||
|
withDrawerActions
|
||||||
)(JournalDeleteAlert);
|
)(JournalDeleteAlert);
|
||||||
|
|||||||
Reference in New Issue
Block a user