File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,6 @@ export const baseSeedSchema = z
1515 locationObjectId : z
1616 . string ( )
1717 . refine ( Types . ObjectId . isValid , 'Invalid location objectId' ) ,
18- isFallback : z . boolean ( ) . optional ( ) . default ( false ) // Assume false unless otherwise specified
18+ isFallback : z . boolean ( ) . optional ( )
1919 } )
2020 . meta ( { model : Seed } ) ;
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ import { baseSeedSchema } from './seed.base';
44export const createSeedSchema = baseSeedSchema
55 . pick ( {
66 locationObjectId : true ,
7- isFallback : true
7+ isFallback : true // This marks `isFallback` as acceptable in the request body
88 } )
99 . partial ( {
10- isFallback : true // This marks `isFallback` as optional; defaults to false unless otherwise specified as declared in the base schema
10+ isFallback : true // This marks `isFallback` as optional
1111 } )
1212 . strict ( )
1313 . meta ( { model : Seed } ) ;
Original file line number Diff line number Diff line change @@ -18,12 +18,10 @@ export const baseUserSchema = z
1818 . length ( 10 , 'Phone number must be exactly 10 digits' )
1919 . regex ( / ^ \d + $ / , 'Phone number must contain only digits' ) ,
2020 role : z . enum ( Role ) ,
21- approval : z . object ( {
22- status : z . enum ( ApprovalStatus ) . default ( ApprovalStatus . PENDING ) ,
23- approvedByUserObjectId : z
24- . string ( )
25- . refine ( Types . ObjectId . isValid , 'Invalid user objectId' )
26- } ) ,
21+ approvalStatus : z . enum ( ApprovalStatus ) ,
22+ approvedByUserObjectId : z
23+ . string ( )
24+ . refine ( Types . ObjectId . isValid , 'Invalid user objectId' ) ,
2725 locationObjectId : z
2826 . string ( )
2927 . refine ( Types . ObjectId . isValid , 'Invalid location objectId' ) ,
You can’t perform that action at this time.
0 commit comments