From eb03188d78fefdc42ac9be7ce17073d072be2754 Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Pardo Date: Wed, 18 May 2022 19:25:50 +0200 Subject: [PATCH] fix: dont validate read event-type --- pages/api/event-types/[id].ts | 2 +- pages/api/event-types/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/api/event-types/[id].ts b/pages/api/event-types/[id].ts index 6319b48b9e..19ca5e0cbb 100644 --- a/pages/api/event-types/[id].ts +++ b/pages/api/event-types/[id].ts @@ -55,7 +55,7 @@ export async function eventTypeById( case "GET": await prisma.eventType .findUnique({ where: { id: safeQuery.data.id } }) - .then((data) => schemaEventTypeReadPublic.parse(data)) + // .then((data) => schemaEventTypeReadPublic.parse(data)) .then((event_type) => res.status(200).json({ event_type })) .catch((error: Error) => res.status(404).json({ diff --git a/pages/api/event-types/index.ts b/pages/api/event-types/index.ts index 163fa501fb..4570934b17 100644 --- a/pages/api/event-types/index.ts +++ b/pages/api/event-types/index.ts @@ -30,8 +30,8 @@ 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((eventType) => schemaEventTypeReadPublic.parse(eventType)); + if (data) res.status(200).json({ event_types: data }); else (error: Error) => res.status(404).json({