fix: dont parse on read event-type

pull/9078/head
Agusti Fernandez Pardo 2022-05-17 22:32:49 +02:00
parent a39d396c8e
commit fa157961be
2 changed files with 1 additions and 2 deletions

View File

@ -39,7 +39,6 @@ const schemaEventTypeBaseParams = z
description: z.string().optional().nullable(),
length: z.number().int(),
locations: jsonSchema.optional().nullable().or(z.null()),
metadata: z.any().optional().nullable().or(z.null()),
recurringEvent: jsonSchema.optional().nullable().or(z.null()),
})
.strict();

View File

@ -30,7 +30,7 @@ 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));
const event_types = data.map((eventType) => eventType);
if (event_types) res.status(200).json({ event_types });
else
(error: Error) =>