fix: parse metadata
parent
fa157961be
commit
f2ea38b440
|
@ -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) =>
|
||||||
|
|
Loading…
Reference in New Issue