mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
14 lines
366 B
JavaScript
14 lines
366 B
JavaScript
import intl from 'react-intl-universal';
|
|
|
|
// handle delete errors.
|
|
export const transformErrors = (errors, { setErrors, setCalloutCode }) => {
|
|
if (
|
|
errors.find((error) => error.type === 'CANNOT_AUTHORIZED_USER_MUTATE_ROLE')
|
|
) {
|
|
setCalloutCode([200]);
|
|
setErrors({
|
|
role_id: intl.get('roles.error.you_cannot_change_your_own_role'),
|
|
});
|
|
}
|
|
};
|