fix: pass data directly

pull/9078/head
Agusti Fernandez Pardo 2022-05-17 22:41:54 +02:00
parent f2ea38b440
commit f8554031ae
1 changed files with 2 additions and 2 deletions

View File

@ -30,8 +30,8 @@ async function createOrlistAllEventTypes(
* description: No event types were found * description: No event types were found
*/ */
const data = await prisma.eventType.findMany({ where: { userId } }); const data = await prisma.eventType.findMany({ where: { userId } });
const event_types = data.map(({ metadata }) => (metadata = JSON.parse(`${metadata}`))); // const event_types = data.map(({ metadata }) => (metadata = JSON.parse(`${metadata}`)));
if (event_types) res.status(200).json({ event_types }); if (data) res.status(200).json({ event_types: data });
else else
(error: Error) => (error: Error) =>
res.status(404).json({ res.status(404).json({