mirror of
https://github.com/strapi/strapi.git
synced 2025-11-13 16:52:18 +00:00
add limitation on the schema validation of the name API and Transfer token
This commit is contained in:
parent
6762ca1ed8
commit
33bdeb8303
@ -2,7 +2,7 @@ import * as yup from 'yup';
|
|||||||
import { translatedErrors } from '@strapi/helper-plugin';
|
import { translatedErrors } from '@strapi/helper-plugin';
|
||||||
|
|
||||||
const schema = yup.object().shape({
|
const schema = yup.object().shape({
|
||||||
name: yup.string(translatedErrors.string).required(translatedErrors.required),
|
name: yup.string(translatedErrors.string).max(100).required(translatedErrors.required),
|
||||||
type: yup
|
type: yup
|
||||||
.string(translatedErrors.string)
|
.string(translatedErrors.string)
|
||||||
.oneOf(['read-only', 'full-access', 'custom'])
|
.oneOf(['read-only', 'full-access', 'custom'])
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import * as yup from 'yup';
|
|||||||
import { translatedErrors } from '@strapi/helper-plugin';
|
import { translatedErrors } from '@strapi/helper-plugin';
|
||||||
|
|
||||||
const schema = yup.object().shape({
|
const schema = yup.object().shape({
|
||||||
name: yup.string(translatedErrors.string).required(translatedErrors.required),
|
name: yup.string(translatedErrors.string).max(100).required(translatedErrors.required),
|
||||||
description: yup.string().nullable(),
|
description: yup.string().nullable(),
|
||||||
lifespan: yup.number().integer().min(0).nullable().defined(translatedErrors.required),
|
lifespan: yup.number().integer().min(0).nullable().defined(translatedErrors.required),
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user