File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
front/src/views/Transfers/CreateTransferAgreement/components Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -21,21 +21,23 @@ export interface IBasesForOrganisationData {
2121 bases : IBaseData [ ] ;
2222}
2323
24- const singleSelectOptionSchema = z . object ( {
24+ const singleSelectOptionObject = {
2525 label : z . string ( ) ,
2626 value : z . string ( ) ,
27- } ) ;
27+ } ;
2828
2929export const TransferAgreementFormDataSchema = z
3030 . object ( {
31- currentOrganisationSelectedBases : singleSelectOptionSchema
31+ currentOrganisationSelectedBases : z
32+ . object ( singleSelectOptionObject )
3233 . array ( )
3334 . min ( 1 , "Please select at least one base" ) ,
3435
35- partnerOrganisation : singleSelectOptionSchema
36- . refine ( Boolean , { error : "Please select a partner organisation" } )
37- . transform ( ( selectedOption ) => selectedOption || { label : "" , value : "" } ) ,
38- partnerOrganisationSelectedBases : singleSelectOptionSchema . array ( ) . optional ( ) ,
36+ partnerOrganisation : z . object ( singleSelectOptionObject , {
37+ error : ( iss ) =>
38+ iss . input === undefined ? "Please select a partner organisation" : "Invalid input." ,
39+ } ) ,
40+ partnerOrganisationSelectedBases : z . object ( singleSelectOptionObject ) . array ( ) . optional ( ) ,
3941 validFrom : z
4042 . date ( {
4143 error : ( issue ) =>
You can’t perform that action at this time.
0 commit comments