File tree Expand file tree Collapse file tree 2 files changed +14
-17
lines changed Expand file tree Collapse file tree 2 files changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -310,11 +310,12 @@ export class Controller {
310
310
const { error : parsingError , data : parsedContacts } =
311
311
contactsGetSchema . safeParse ( contacts ) ;
312
312
313
- if ( parsingError )
313
+ if ( parsingError ) {
314
314
throw new ServerError (
315
315
500 ,
316
316
`Invalid contacts received: ${ parsingError . message } ` ,
317
317
) ;
318
+ }
318
319
319
320
await this . pubSubContactStreamingClient ?. publishMessage (
320
321
{
Original file line number Diff line number Diff line change @@ -75,14 +75,12 @@ export const contactSchema = z.object({
75
75
contactUrl : z . string ( ) . nullable ( ) ,
76
76
avatarUrl : z . string ( ) . nullable ( ) ,
77
77
readonly : z . boolean ( ) . optional ( ) ,
78
- phoneNumbers : z
79
- . array (
80
- z . object ( {
81
- label : z . string ( ) ,
82
- phoneNumber : z . string ( ) ,
83
- } ) ,
84
- )
85
- . nonempty ( ) ,
78
+ phoneNumbers : z . array (
79
+ z . object ( {
80
+ label : z . string ( ) ,
81
+ phoneNumber : z . string ( ) ,
82
+ } ) ,
83
+ ) ,
86
84
} ) ;
87
85
88
86
export const contactsGetSchema = z . array ( contactSchema ) ;
@@ -95,12 +93,10 @@ export const contactCreateSchema = z.object({
95
93
organization : z . string ( ) . nullable ( ) . optional ( ) . default ( null ) ,
96
94
contactUrl : z . string ( ) . nullable ( ) . optional ( ) . default ( null ) ,
97
95
avatarUrl : z . string ( ) . nullable ( ) . optional ( ) . default ( null ) ,
98
- phoneNumbers : z
99
- . array (
100
- z . object ( {
101
- label : z . string ( ) ,
102
- phoneNumber : z . string ( ) ,
103
- } ) ,
104
- )
105
- . nonempty ( ) ,
96
+ phoneNumbers : z . array (
97
+ z . object ( {
98
+ label : z . string ( ) ,
99
+ phoneNumber : z . string ( ) ,
100
+ } ) ,
101
+ ) ,
106
102
} ) ;
You can’t perform that action at this time.
0 commit comments