Skip to content
Snippets Groups Projects
Unverified Commit d3d21fec authored by alihadi-mazeh's avatar alihadi-mazeh Committed by GitHub
Browse files

Added duplicate email error to Admin User Create (#4618)

* Added a toast error to account for duplicate emails when creating a user from the admin panel

* eslint fixes
parent f681999d
Branches
Tags release-3.0.0-beta.10
No related merge requests found
......@@ -14,8 +14,12 @@ export default function useAdminCreateUser({ onSettled }) {
queryClient.invalidateQueries('getAdminUsers');
toast.success(t('toast.success.user.user_created'));
},
onError: () => {
onError: (err) => {
if (err.response.data.errors === 'EmailAlreadyExists') {
toast.error(t('toast.error.users.email_exists'));
} else {
toast.error(t('toast.error.problem_completing_action'));
}
},
onSettled,
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment