mirror of
https://github.com/strapi/strapi.git
synced 2025-11-19 19:50:46 +00:00
Fix saving up settings
This commit is contained in:
parent
bb53ba8638
commit
d676242c8f
@ -4,15 +4,14 @@ import { translatedErrors } from '@strapi/helper-plugin';
|
|||||||
const URL_REGEX = new RegExp('(^$)|((https?://.*)(d*)/?(.*))');
|
const URL_REGEX = new RegExp('(^$)|((https?://.*)(d*)/?(.*))');
|
||||||
|
|
||||||
const schema = yup.object().shape({
|
const schema = yup.object().shape({
|
||||||
email_confirmation_redirection: yup
|
email_confirmation_redirection: yup.mixed().when('email_confirmation', {
|
||||||
.string(translatedErrors.string)
|
is: true,
|
||||||
.matches(URL_REGEX, translatedErrors.regex)
|
then: yup
|
||||||
.nullable()
|
.string()
|
||||||
.when('email_confirmation', {
|
.matches(URL_REGEX)
|
||||||
is: true,
|
.required(),
|
||||||
then: yup.string().required(translatedErrors.required),
|
otherwise: yup.string().nullable(),
|
||||||
otherwise: yup.string(),
|
}),
|
||||||
}),
|
|
||||||
email_reset_password: yup
|
email_reset_password: yup
|
||||||
.string(translatedErrors.string)
|
.string(translatedErrors.string)
|
||||||
.matches(URL_REGEX, translatedErrors.regex)
|
.matches(URL_REGEX, translatedErrors.regex)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user