From e3704f6dd9586ac163f572d840ce24742a654ce4 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Mon, 21 Feb 2022 14:14:03 +0100 Subject: [PATCH] =?UTF-8?q?fix(api):=20=F0=9F=A9=B9=20Switch=20from=20step?= =?UTF-8?q?Id=20to=20id=20(for=20Zapier)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/viewer/pages/api/typebots/[typebotId]/webhookSteps.ts | 4 ++-- apps/viewer/playwright/tests/api.spec.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/viewer/pages/api/typebots/[typebotId]/webhookSteps.ts b/apps/viewer/pages/api/typebots/[typebotId]/webhookSteps.ts index d740a091e..0bc94926e 100644 --- a/apps/viewer/pages/api/typebots/[typebotId]/webhookSteps.ts +++ b/apps/viewer/pages/api/typebots/[typebotId]/webhookSteps.ts @@ -15,7 +15,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { select: { blocks: true }, }) const emptyWebhookSteps = (typebot?.blocks as Block[]).reduce< - { blockId: string; stepId: string; name: string }[] + { blockId: string; id: string; name: string }[] >((emptyWebhookSteps, block) => { const steps = block.steps.filter( (step) => step.type === IntegrationStepType.WEBHOOK && !step.webhook.url @@ -23,8 +23,8 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { return [ ...emptyWebhookSteps, ...steps.map((s) => ({ + id: s.id, blockId: s.blockId, - stepId: s.id, name: `${block.title} > ${s.id}`, })), ] diff --git a/apps/viewer/playwright/tests/api.spec.ts b/apps/viewer/playwright/tests/api.spec.ts index ef3fb9556..af10a7efb 100644 --- a/apps/viewer/playwright/tests/api.spec.ts +++ b/apps/viewer/playwright/tests/api.spec.ts @@ -49,7 +49,7 @@ test('can get webhook steps', async ({ request }) => { const { steps } = await response.json() expect(steps).toHaveLength(1) expect(steps[0]).toEqual({ - stepId: 'step1', + id: 'step1', blockId: 'block1', name: 'Block #1 > step1', })