mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
fix(vendor): catch error message.
This commit is contained in:
15
client/src/containers/Vendors/utils.js
Normal file
15
client/src/containers/Vendors/utils.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import { AppToaster } from 'components';
|
||||
import { formatMessage } from 'services/intl';
|
||||
|
||||
export const transformErrors = (errors) => {
|
||||
if (errors.find((error) => error.type === 'VENDOR.HAS.ASSOCIATED.BILLS')) {
|
||||
AppToaster.show({
|
||||
message: formatMessage({
|
||||
id: 'cannot_delete_vendor_that_has_associated_purchase_bills',
|
||||
}),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user