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', })