Skip to content

Commit

Permalink
fix(engine): 🐛 Standalone '?' when no query params
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Mar 1, 2022
1 parent ae347ee commit d6c3e8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ const executeWebhook =
})
try {
const response = await got(
parseVariables(variables)(webhook.url + `?${queryParams}`),
parseVariables(variables)(
webhook.url + (queryParams !== '' ? `?${queryParams}` : '')
),
{
method: webhook.method as Method,
headers,
Expand Down
8 changes: 6 additions & 2 deletions packages/bot-engine/src/services/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,12 @@ const executeWebhook = async (
resultValues,
},
})
const statusCode = (data as Record<string, string>).statusCode.toString()
const isError = statusCode.startsWith('4') || statusCode.startsWith('5')
const statusCode = (
data as Record<string, string> | undefined
)?.statusCode.toString()
const isError = statusCode
? statusCode?.startsWith('4') || statusCode?.startsWith('5')
: true
onNewLog({
status: error ? 'error' : isError ? 'warning' : 'success',
description: isError
Expand Down

2 comments on commit d6c3e8d

@vercel
Copy link

@vercel vercel bot commented on d6c3e8d Mar 1, 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-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app
app.typebot.io

@vercel
Copy link

@vercel vercel bot commented on d6c3e8d Mar 1, 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.