@@ -101,6 +101,7 @@ const formSchema = z.object({
101
101
breed : z
102
102
. array ( z . nativeEnum ( Breed ) )
103
103
. transform ( ( val , ctx ) => arrayEmptyValidation ( val , ctx , "Breed" ) ) ,
104
+ otherBreedDescription : z . string ( ) . optional ( ) ,
104
105
temperament : z . array ( z . nativeEnum ( Temperament ) ) ,
105
106
medical : z . array ( z . nativeEnum ( Medical ) ) ,
106
107
behavioral : z . array ( z . nativeEnum ( Behavioral ) ) ,
@@ -155,6 +156,7 @@ const EditPostModal: React.FC<{
155
156
medical,
156
157
gender,
157
158
breed,
159
+ otherBreedDescription,
158
160
getsAlongWithOlderKids,
159
161
getsAlongWithYoungKids,
160
162
getsAlongWithLargeDogs,
@@ -172,6 +174,7 @@ const EditPostModal: React.FC<{
172
174
type,
173
175
size,
174
176
breed,
177
+ otherBreedDescription,
175
178
draft,
176
179
temperament,
177
180
spayNeuterStatus,
@@ -490,42 +493,42 @@ const EditPostModal: React.FC<{
490
493
onClick = {
491
494
isContentView
492
495
? ( ) => {
493
- setIsContentView ( false ) ;
494
- }
496
+ setIsContentView ( false ) ;
497
+ }
495
498
: ( ) => {
496
- //TODO: Wait for success to close.
497
- const validation = formSchema . safeParse ( formState ) ;
498
- if ( validation . success ) {
499
- setIsLoading ( true ) ;
500
- editPost ( ! formState . draft )
501
- . then ( ( ) => {
502
- onClose ( ) ;
503
- setFileArr ( fileArr ) ;
504
- setIsContentView ( true ) ;
505
- dispatch ( {
506
- type : "clear" ,
507
- } ) ;
508
- } )
509
- . finally ( ( ) => {
510
- setIsLoading ( false ) ;
499
+ //TODO: Wait for success to close.
500
+ const validation = formSchema . safeParse ( formState ) ;
501
+ if ( validation . success ) {
502
+ setIsLoading ( true ) ;
503
+ editPost ( ! formState . draft )
504
+ . then ( ( ) => {
505
+ onClose ( ) ;
506
+ setFileArr ( fileArr ) ;
507
+ setIsContentView ( true ) ;
508
+ dispatch ( {
509
+ type : "clear" ,
511
510
} ) ;
512
- } else {
513
- toast . closeAll ( ) ;
514
- toast ( {
515
- title : "Error" ,
516
- description : validation . error . issues
517
- . map ( ( issue ) => issue . message )
518
- . join ( "\r\n" ) ,
519
- containerStyle : {
520
- whiteSpace : "pre-line" ,
521
- } ,
522
- status : "error" ,
523
- duration : 5000 ,
524
- isClosable : true ,
525
- position : "top" ,
511
+ } )
512
+ . finally ( ( ) => {
513
+ setIsLoading ( false ) ;
526
514
} ) ;
527
- }
515
+ } else {
516
+ toast . closeAll ( ) ;
517
+ toast ( {
518
+ title : "Error" ,
519
+ description : validation . error . issues
520
+ . map ( ( issue ) => issue . message )
521
+ . join ( "\r\n" ) ,
522
+ containerStyle : {
523
+ whiteSpace : "pre-line" ,
524
+ } ,
525
+ status : "error" ,
526
+ duration : 5000 ,
527
+ isClosable : true ,
528
+ position : "top" ,
529
+ } ) ;
528
530
}
531
+ }
529
532
}
530
533
>
531
534
{ isContentView ? "Next" : "Post" }
0 commit comments