mirror of
				https://github.com/strapi/strapi.git
				synced 2025-11-03 19:36:20 +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';
 | 
			
		||||
 | 
			
		||||
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'])
 | 
			
		||||
 | 
			
		||||
@ -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),
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user