fix: auth pages errors handler

This commit is contained in:
Ahmed Bouhuolia
2025-10-30 19:27:29 +02:00
parent 4a0091d3f8
commit 0588a30c88
14 changed files with 111 additions and 75 deletions

View File

@@ -32,13 +32,11 @@ export default function Login() {
email: values.crediential,
password: values.password,
}).catch(({ response }) => {
const {
data: { errors },
} = response;
const toastBuilders = transformLoginErrorsToToasts(errors);
const { data: error } = response;
const toastMessages = transformLoginErrorsToToasts(error);
toastBuilders.forEach((builder) => {
Toaster.show(builder);
toastMessages.forEach((toastMessage) => {
Toaster.show(toastMessage);
});
setSubmitting(false);
});