From 1c758d39e5c3653a2d97c2b4f492d3db38bba7ac Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Tue, 22 Feb 2022 14:41:55 +0100 Subject: [PATCH] =?UTF-8?q?chore(api):=20=F0=9F=93=84=20Change=20patch=20w?= =?UTF-8?q?ebhook=20to=20post?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../blocks/[blockId]/steps/[stepId]/subscribeWebhook.ts | 2 +- .../blocks/[blockId]/steps/[stepId]/unsubscribeWebhook.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/steps/[stepId]/subscribeWebhook.ts b/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/steps/[stepId]/subscribeWebhook.ts index 1b560c6de..71979796d 100644 --- a/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/steps/[stepId]/subscribeWebhook.ts +++ b/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/steps/[stepId]/subscribeWebhook.ts @@ -7,7 +7,7 @@ import { authenticateUser } from 'services/api/utils' import { isWebhookStep, methodNotAllowed } from 'utils' const handler = async (req: NextApiRequest, res: NextApiResponse) => { - if (req.method === 'PATCH') { + if (req.method === 'POST') { const user = await authenticateUser(req) if (!user) return res.status(401).json({ message: 'Not authenticated' }) const body = req.body as Record diff --git a/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/steps/[stepId]/unsubscribeWebhook.ts b/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/steps/[stepId]/unsubscribeWebhook.ts index 4ac124ca4..9f7209f92 100644 --- a/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/steps/[stepId]/unsubscribeWebhook.ts +++ b/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/steps/[stepId]/unsubscribeWebhook.ts @@ -8,7 +8,7 @@ import { omit } from 'services/utils' import { isWebhookStep, methodNotAllowed } from 'utils' const handler = async (req: NextApiRequest, res: NextApiResponse) => { - if (req.method === 'DELETE') { + if (req.method === 'POST') { const user = await authenticateUser(req) if (!user) return res.status(401).json({ message: 'Not authenticated' }) const typebotId = req.query.typebotId.toString()