fix: pass data directly
parent
f2ea38b440
commit
f8554031ae
|
@ -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(({ metadata }) => (metadata = JSON.parse(`${metadata}`)));
|
||||
if (event_types) res.status(200).json({ event_types });
|
||||
// const event_types = data.map(({ metadata }) => (metadata = JSON.parse(`${metadata}`)));
|
||||
if (data) res.status(200).json({ event_types: data });
|
||||
else
|
||||
(error: Error) =>
|
||||
res.status(404).json({
|
||||
|
|
Loading…
Reference in New Issue