mirror of
https://github.com/strapi/strapi.git
synced 2025-11-06 13:01:40 +00:00
12 lines
347 B
JavaScript
12 lines
347 B
JavaScript
import { translatedErrors } from '@strapi/helper-plugin';
|
|
import * as yup from 'yup';
|
|
|
|
const schema = yup.object().shape({
|
|
restrictedAccess: yup.boolean(),
|
|
password: yup.string().when('restrictedAccess', (value, initSchema) => {
|
|
return value ? initSchema.required(translatedErrors.required) : initSchema;
|
|
}),
|
|
});
|
|
|
|
export default schema;
|