Unlock app when there is an error when creating a user

Signed-off-by: soupette <cyril@strapi.io>
This commit is contained in:
soupette 2021-11-19 09:48:38 +01:00
parent cc03c09253
commit 12299422fa

View File

@ -67,6 +67,8 @@ const ModalForm = ({ queryName, onToggle }) => {
try {
await postMutation.mutateAsync(body);
} catch (err) {
unlockApp();
if (err?.response?.data.message === 'Email already taken') {
setErrors({ email: err.response.data.message });
}