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({