feat:(item) : catch error message.

This commit is contained in:
elforjani3
2021-03-24 12:54:45 +02:00
parent 542110fdf3
commit 14f4698e10
2 changed files with 10 additions and 1 deletions

View File

@@ -107,6 +107,14 @@ function ItemForm({
if (errors.find((e) => e.type === 'ITEM.NAME.ALREADY.EXISTS')) {
fields.name = formatMessage({ id: 'the_name_used_before' });
}
if (errors.find((e) => e.type === 'INVENTORY_ACCOUNT_CANNOT_MODIFIED')) {
AppToaster.show({
message: formatMessage({
id: 'cannot_change_item_inventory_account',
}),
intent: Intent.DANGER,
});
}
return fields;
};

View File

@@ -1034,6 +1034,7 @@ export default {
'This customer cannot be deleted as it is associated with transactions.',
this_vendor_cannot_be_deleted_as_it_is_associated_with_transactions:
'This vendor cannot be deleted as it is associated with transactions.',
currency_sign: 'Currency sign',
cannot_change_item_inventory_account:
'Cannot change item inventory account while the item has transactions.',
};