From b9a2e0f4c6ca1f8f617c57a319cb67b22f8482ae Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Pardo Date: Fri, 27 May 2022 21:58:38 +0200 Subject: [PATCH] fix: event types validations recurring event and locations nullable: --- lib/validations/event-type.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/validations/event-type.ts b/lib/validations/event-type.ts index bd2ba68728..b67f13fa6a 100644 --- a/lib/validations/event-type.ts +++ b/lib/validations/event-type.ts @@ -102,15 +102,18 @@ export const schemaEventTypeReadPublic = EventType.pick({ until: z.date().optional(), tzid: timeZone.optional(), }) - .optional(), - locations: z.array( - z.object({ - link: z.string().optional(), - address: z.string().optional(), - hostPhoneNumber: z.string().optional(), - type: z.nativeEnum(DefaultLocationType).or(z.nativeEnum(AppStoreLocationType)), - }) - ), + .optional() + .nullable(), + locations: z + .array( + z.object({ + link: z.string().optional(), + address: z.string().optional(), + hostPhoneNumber: z.string().optional(), + type: z.nativeEnum(DefaultLocationType).or(z.nativeEnum(AppStoreLocationType)), + }) + ) + .nullable(), metadata: jsonSchema.nullable(), }) );