feat:(customer & vendr) : catch message error.

This commit is contained in:
elforjani3
2021-03-22 18:00:37 +02:00
parent 13f94e7e35
commit 40806668df
3 changed files with 34 additions and 4 deletions

View File

@@ -22,4 +22,13 @@ export const transformErrors = (errors) => {
intent: Intent.DANGER,
});
}
if (errors.find((error) => error.type === 'CUSTOMER_HAS_TRANSACTIONS')) {
AppToaster.show({
message: formatMessage({
id:
'this_customer_cannot_be_deleted_as_it_is_associated_with_transactions',
}),
intent: Intent.DANGER,
});
}
};

View File

@@ -12,4 +12,13 @@ export const transformErrors = (errors) => {
intent: Intent.DANGER,
});
}
if (errors.find((error) => error.type === 'VENDOR_HAS_TRANSACTIONS')) {
AppToaster.show({
message: formatMessage({
id:
'this_vendor_cannot_be_deleted_as_it_is_associated_with_transactions',
}),
intent: Intent.DANGER,
});
}
};