From 14f4698e10522da399ecc1d2b34141a2b45f51ab Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Wed, 24 Mar 2021 12:54:45 +0200 Subject: [PATCH] feat:(item) : catch error message. --- client/src/containers/Items/ItemForm.js | 8 ++++++++ client/src/lang/en/index.js | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/client/src/containers/Items/ItemForm.js b/client/src/containers/Items/ItemForm.js index 420f1f31a..91e74a14d 100644 --- a/client/src/containers/Items/ItemForm.js +++ b/client/src/containers/Items/ItemForm.js @@ -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; }; diff --git a/client/src/lang/en/index.js b/client/src/lang/en/index.js index 16ff6167e..f6ba635b3 100644 --- a/client/src/lang/en/index.js +++ b/client/src/lang/en/index.js @@ -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.', };