fix(webapp): change the error code handler

This commit is contained in:
a.bouhuolia
2023-05-08 00:35:44 +02:00
parent ce38c71fa7
commit be10b8934d

View File

@@ -98,15 +98,7 @@ export const transformRegisterErrorsToForm = (errors) => {
export const transformRegisterToastMessages = (errors) => {
const toastErrors = [];
if (errors.some((e) => e.type === 'SIGNUP_NOT_ALLOWED_EMAIL_DOMAIN')) {
toastErrors.push({
message:
'The sign-up is restricted, the given email domain is not allowed to sign-up.',
intent: Intent.DANGER,
});
} else if (
errors.some((e) => e.type === 'SIGNUP_NOT_ALLOWED_EMAIL_ADDRESS')
) {
if (errors.some((e) => e.type === 'SIGNUP_RESTRICTED_NOT_ALLOWED')) {
toastErrors.push({
message:
'The sign-up is restricted, the given email address is not allowed to sign-up.',