mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat: handle error delete role.
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
|
||||
import RolesFormContent from './RolesFormContent';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import { handleDeleteErrors } from '../utils';
|
||||
|
||||
import { compose, transformToForm } from 'utils';
|
||||
|
||||
@@ -82,8 +83,14 @@ function RolesForm({
|
||||
history.push('/preferences/users');
|
||||
};
|
||||
|
||||
const onError = (errors) => {
|
||||
const onError = ({
|
||||
response: {
|
||||
data: { errors },
|
||||
},
|
||||
}) => {
|
||||
setSubmitting(false);
|
||||
|
||||
handleDeleteErrors(errors);
|
||||
};
|
||||
if (isNewMode) {
|
||||
createRolePermissionMutate(form).then(onSuccess).catch(onError);
|
||||
|
||||
Reference in New Issue
Block a user