File tree Expand file tree Collapse file tree
frontend/src/pages/CalendarPage/Components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,9 +23,8 @@ export const decimalMinZero = (validationObject: ValidationChain): ValidationCha
2323 . withMessage ( 'Value must be greater than or equal to zero' ) ;
2424} ;
2525
26- //Const to return if an input is a string and is not empty
2726export const nonEmptyString = ( validationObject : ValidationChain ) : ValidationChain => {
28- return validationObject . isString ( ) . not ( ) . isEmpty ( ) ;
27+ return validationObject . isString ( ) . not ( ) . isEmpty ( { ignore_whitespace : true } ) ;
2928} ;
3029
3130export const isRole = ( validationObject : ValidationChain ) : ValidationChain => {
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ export interface EventPayload {
117117}
118118
119119const schema = yup . object ( ) . shape ( {
120- title : yup . string ( ) . required ( 'Title is required' ) ,
120+ title : yup . string ( ) . required ( 'Title is required' ) . trim ( ) . min ( 1 , 'Title cannot be only whitespace' ) ,
121121 eventTypeId : yup . string ( ) . required ( 'Event Type is required' ) ,
122122 requiredMemberIds : yup . array ( ) . of ( yup . string ( ) . required ( ) ) . default ( [ ] ) ,
123123 optionalMemberIds : yup . array ( ) . of ( yup . string ( ) . required ( ) ) . default ( [ ] ) ,
You can’t perform that action at this time.
0 commit comments