Fix saving up settings

This commit is contained in:
Pierre Noël 2021-12-03 11:49:22 +01:00
parent bb53ba8638
commit d676242c8f

View File

@ -4,15 +4,14 @@ import { translatedErrors } from '@strapi/helper-plugin';
const URL_REGEX = new RegExp('(^$)|((https?://.*)(d*)/?(.*))');
const schema = yup.object().shape({
email_confirmation_redirection: yup
.string(translatedErrors.string)
.matches(URL_REGEX, translatedErrors.regex)
.nullable()
.when('email_confirmation', {
is: true,
then: yup.string().required(translatedErrors.required),
otherwise: yup.string(),
}),
email_confirmation_redirection: yup.mixed().when('email_confirmation', {
is: true,
then: yup
.string()
.matches(URL_REGEX)
.required(),
otherwise: yup.string().nullable(),
}),
email_reset_password: yup
.string(translatedErrors.string)
.matches(URL_REGEX, translatedErrors.regex)