refactoring(bill & item) : catch error message.

This commit is contained in:
elforjani3
2021-03-19 19:10:26 +02:00
parent 0ba260cc70
commit 16ce29cafa
3 changed files with 35 additions and 1 deletions

View File

@@ -37,4 +37,17 @@ export const handleDeleteErrors = (errors) => {
intent: Intent.DANGER,
});
}
if (
errors.find(
(error) => error.type === 'TYPE_CANNOT_CHANGE_WITH_ITEM_HAS_TRANSACTIONS',
)
) {
AppToaster.show({
message: formatMessage({
id:
'cannot_change_item_type_to_inventory_with_item_has_associated_transactions',
}),
intent: Intent.DANGER,
});
}
};