feat(warehouse & Branch): handle error.

This commit is contained in:
elforjani13
2022-03-07 21:53:54 +02:00
parent a8311f1798
commit e03dee2a9f
6 changed files with 46 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import { Intent, Alert } from '@blueprintjs/core';
import { AppToaster } from 'components';
import { useDeleteBranch } from 'hooks/query';
import { handleDeleteErrors } from '../../Preferences/Branches/utils';
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
import withAlertActions from 'containers/Alert/withAlertActions';
@@ -24,7 +25,6 @@ function BranchDeleteAlert({
// #withAlertActions
closeAlert,
}) {
const { mutateAsync: deleteBranch, isLoading } = useDeleteBranch();
// Handle cancel delete alert.
@@ -46,7 +46,9 @@ function BranchDeleteAlert({
response: {
data: { errors },
},
}) => {},
}) => {
handleDeleteErrors(errors);
},
)
.finally(() => {
closeAlert(name);