From f1175a06f64c753599efeedde515c9035e14111b Mon Sep 17 00:00:00 2001 From: Agusti Fernandez Pardo Date: Fri, 20 May 2022 21:27:11 +0200 Subject: [PATCH] fix: hooks dont parse before read --- pages/api/hooks/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/api/hooks/index.ts b/pages/api/hooks/index.ts index 0a81da7ec5..12efc93a74 100644 --- a/pages/api/hooks/index.ts +++ b/pages/api/hooks/index.ts @@ -30,8 +30,8 @@ async function createOrlistAllWebhooks( * description: No webhooks were found */ const data = await prisma.webhook.findMany({ where: { userId } }); - const webhooks = data.map((webhook) => schemaWebhookReadPublic.parse(webhook)); - if (webhooks) res.status(200).json({ webhooks }); + // const webhooks = data.map((webhook) => schemaWebhookReadPublic.parse(webhook)); + if (data) res.status(200).json({ webhooks: data }); else (error: Error) => res.status(404).json({