mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: handle errors.
This commit is contained in:
13
src/containers/Preferences/Users/Roles/utils.js
Normal file
13
src/containers/Preferences/Users/Roles/utils.js
Normal file
@@ -0,0 +1,13 @@
|
||||
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 === 'ROLE_PREFINED')) {
|
||||
AppToaster.show({
|
||||
message: intl.get('roles.error.role_is_predefined'),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user