feat(branches & warehouses): handle errors.

This commit is contained in:
elforjani13
2022-03-13 15:20:00 +02:00
parent 0bbd31dcce
commit bd3059ecd8
4 changed files with 19 additions and 3 deletions

View File

@@ -12,4 +12,10 @@ export const handleDeleteErrors = (errors) => {
intent: Intent.DANGER,
});
}
if (errors.some((e) => e.type === 'BRANCH_HAS_ASSOCIATED_TRANSACTIONS')) {
AppToaster.show({
message: intl.get('branche.error.branch_has_associated_transactions'),
intent: Intent.DANGER,
});
}
};

View File

@@ -14,4 +14,12 @@ export const handleDeleteErrors = (errors) => {
intent: Intent.DANGER,
});
}
if (errors.some((e) => e.type === 'WAREHOUSE_HAS_ASSOCIATED_TRANSACTIONS')) {
AppToaster.show({
message: intl.get(
'warehouse.error.warehouse_has_associated_transactions',
),
intent: Intent.DANGER,
});
}
};

View File

@@ -19,7 +19,7 @@ import ReceiptItemsEntriesEditor from './ReceiptItemsEntriesEditor';
import ReceiptFormFloatingActions from './ReceiptFormFloatingActions';
import ReceiptFormFooter from './ReceiptFormFooter';
import ReceiptFormDialogs from './ReceiptFormDialogs';
import ReceiptFormTopBar from './ReceiptFormTopBar';
import ReceiptFormTopBar from './ReceiptFormTopbar';
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import withSettings from 'containers/Settings/withSettings';