File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,15 @@ const Roles = z
3333 )
3434 )
3535 . strict ( ) ;
36-
37- export const ContributorSchema = ( { image } : SchemaContext ) => z . object ( {
38- name : z . string ( ) ,
39- avatar : image ( ) ,
40- type : z . enum ( [ "founder" , "contractor" , "community" ] ) . array ( ) ,
41- roles : Roles ,
42- contacts : SocialsSchema . array ( )
43- . default ( [ ] )
44- . transform ( ( contacts ) => contacts . map ( transformSocial ) ) ,
45- } ) ;
36+
37+ const TYPE = z . enum ( [ "founder" , "contractor" , "community" ] ) ;
38+ export const ContributorSchema = ( { image } : SchemaContext ) =>
39+ z . object ( {
40+ name : z . string ( ) ,
41+ avatar : image ( ) ,
42+ type : z . union ( [ TYPE , TYPE . array ( ) ] ) ,
43+ roles : Roles ,
44+ contacts : SocialsSchema . array ( )
45+ . default ( [ ] )
46+ . transform ( ( contacts ) => contacts . map ( transformSocial ) ) ,
47+ } ) ;
You can’t perform that action at this time.
0 commit comments