From 1717f14e833c07be8a12da216df002c72e7674e2 Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Pardo Date: Fri, 20 May 2022 03:40:14 +0200 Subject: [PATCH] fix: event type validations skip --- lib/types.ts | 4 ++-- pages/api/event-types/index.ts | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/types.ts b/lib/types.ts index f61e5d7f1c..681e88de65 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -153,10 +153,10 @@ interface EventTypeExtended extends Omit; + event_type?: Partial; }; export type EventTypesResponse = BaseResponse & { - event_types?: Partial[]; + event_types?: Partial[]; }; // Payment diff --git a/pages/api/event-types/index.ts b/pages/api/event-types/index.ts index 163fa501fb..420983a162 100644 --- a/pages/api/event-types/index.ts +++ b/pages/api/event-types/index.ts @@ -30,8 +30,10 @@ async function createOrlistAllEventTypes( * description: No event types were found */ const data = await prisma.eventType.findMany({ where: { userId } }); - const event_types = data.map((eventType) => schemaEventTypeReadPublic.parse(eventType)); - if (event_types) res.status(200).json({ event_types }); + // const event_types = data.map( + // async (eventType) => await schemaEventTypeReadPublic.safeParseAsync(eventType) + // ); + if (data) res.status(200).json({ event_types: data }); else (error: Error) => res.status(404).json({