File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -75,9 +75,9 @@ export function buildValidationSchema(fields: FormField[]) {
7575 break ;
7676
7777 case 'number' :
78- baseType = Yup . number ( ) . integer (
79- `${ field . label } must be a valid number`
80- ) ;
78+ baseType = Yup . number ( )
79+ . integer ( `${ field . label } must be a number` )
80+ . typeError ( ` ${ field . label } must be a number` ) ;
8181
8282 fieldValidation = baseType ;
8383 fieldValidation = checkRequired ( fieldValidation , field , baseType ) ;
@@ -108,7 +108,7 @@ export function buildValidationSchema(fields: FormField[]) {
108108 typeof baseType === 'undefined' ||
109109 typeof fieldValidation === 'undefined'
110110 ) {
111- baseType = Yup . string ( ) ;
111+ baseType = Yup . string ( ) . typeError ( ` ${ field . label } must not be empty` ) ;
112112 fieldValidation = baseType ;
113113 fieldValidation = checkRequired ( fieldValidation , field , baseType ) ;
114114 fieldValidation = checkMinimumLength ( fieldValidation , field ) ;
You can’t perform that action at this time.
0 commit comments