add limitation on the schema validation of the name API and Transfer token

This commit is contained in:
Simone Taeggi 2023-02-22 16:04:30 +01:00
parent 6762ca1ed8
commit 33bdeb8303
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import * as yup from 'yup';
import { translatedErrors } from '@strapi/helper-plugin';
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
.string(translatedErrors.string)
.oneOf(['read-only', 'full-access', 'custom'])

View File

@ -2,7 +2,7 @@ import * as yup from 'yup';
import { translatedErrors } from '@strapi/helper-plugin';
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(),
lifespan: yup.number().integer().min(0).nullable().defined(translatedErrors.required),
});