From f2ea38b44008c6faf5be4bcec8fc2d73dffab898 Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Pardo Date: Tue, 17 May 2022 22:37:43 +0200 Subject: [PATCH] fix: parse metadata --- pages/api/event-types/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/api/event-types/index.ts b/pages/api/event-types/index.ts index 726895fe6c..932a10a11c 100644 --- a/pages/api/event-types/index.ts +++ b/pages/api/event-types/index.ts @@ -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) => eventType); + const event_types = data.map(({ metadata }) => (metadata = JSON.parse(`${metadata}`))); if (event_types) res.status(200).json({ event_types }); else (error: Error) =>