mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-24 00:29:49 +00:00
chore: Refactoring all import directories to alias and all .js|.jsx renamed to be .ts|.tsx
This commit is contained in:
21
src/containers/Preferences/Branches/utils.tsx
Normal file
21
src/containers/Preferences/Branches/utils.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import intl from 'react-intl-universal';
|
||||
import { Intent } from '@blueprintjs/core';
|
||||
import { AppToaster } from '@/components';
|
||||
|
||||
/**
|
||||
* Handle delete errors.
|
||||
*/
|
||||
export const handleDeleteErrors = (errors) => {
|
||||
if (errors.find((error) => error.type === 'COULD_NOT_DELETE_ONLY_BRANCH')) {
|
||||
AppToaster.show({
|
||||
message: intl.get('branch.error.could_not_delete_only_branch'),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
if (errors.some((e) => e.type === 'BRANCH_HAS_ASSOCIATED_TRANSACTIONS')) {
|
||||
AppToaster.show({
|
||||
message: intl.get('branche.error.branch_has_associated_transactions'),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user