fix: parse metadata

pull/9078/head
Agusti Fernandez Pardo 2022-05-17 22:37:43 +02:00
parent fa157961be
commit f2ea38b440
1 changed files with 1 additions and 1 deletions

View File

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