Skip to content

Commit

Permalink
fix(api): 🩹 Switch from stepId to id (for Zapier)
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Feb 21, 2022
1 parent 5edd63c commit e3704f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/viewer/pages/api/typebots/[typebotId]/webhookSteps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ 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
)
return [
...emptyWebhookSteps,
...steps.map((s) => ({
id: s.id,
blockId: s.blockId,
stepId: s.id,
name: `${block.title} > ${s.id}`,
})),
]
Expand Down
2 changes: 1 addition & 1 deletion apps/viewer/playwright/tests/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand Down

2 comments on commit e3704f6

@vercel
Copy link

@vercel vercel bot commented on e3704f6 Feb 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-git-main-typebot-io.vercel.app
app.typebot.io
builder-v2-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e3704f6 Feb 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.