fix: dont validate read event-type

pull/9078/head
Agusti Fernandez Pardo 2022-05-18 19:25:50 +02:00
parent 35ebf53f19
commit eb03188d78
2 changed files with 3 additions and 3 deletions

View File

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

View File

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