Skip to content

Commit

Permalink
🚑 (webhook) Fix webhook execution with default method
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Nov 9, 2023
1 parent 9bb5591 commit 14a3716
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export const executeWebhookBlock = async (
})) as Webhook | null)
: null)
if (!webhook) return { outgoingEdgeId: block.outgoingEdgeId }
const parsedWebhook = await parseWebhookAttributes(
state,
state.typebotsQueue[0].answers
)({ webhook, isCustomBody: block.options?.isCustomBody })
const parsedWebhook = await parseWebhookAttributes(state)({
webhook,
isCustomBody: block.options?.isCustomBody,
})
if (!parsedWebhook) {
logs.push({
status: 'error',
Expand Down Expand Up @@ -77,15 +77,15 @@ export const executeWebhookBlock = async (
const checkIfBodyIsAVariable = (body: string) => /^{{.+}}$/.test(body)

const parseWebhookAttributes =
(state: SessionState, answers: AnswerInSessionState[]) =>
(state: SessionState) =>
async ({
webhook,
isCustomBody,
}: {
webhook: Webhook
isCustomBody?: boolean
}): Promise<ParsedWebhook | undefined> => {
if (!webhook.url || !webhook.method) return
if (!webhook.url) return
const { typebot } = state.typebotsQueue[0]
const basicAuth: { username?: string; password?: string } = {}
const basicAuthHeaderIdx = webhook.headers?.findIndex(
Expand Down Expand Up @@ -114,7 +114,7 @@ const parseWebhookAttributes =
)
const bodyContent = await getBodyContent({
body: webhook.body,
answers,
answers: state.typebotsQueue[0].answers,
variables: typebot.variables,
isCustomBody,
})
Expand Down

3 comments on commit 14a3716

@vercel
Copy link

@vercel vercel bot commented on 14a3716 Nov 9, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on 14a3716 Nov 9, 2023

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 14a3716 Nov 9, 2023

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:

viewer-v2 – ./apps/viewer

bii.bj
1stop.au
houss.io
wasap.nl
x.cr8.ai
yobot.me
klujo.com
me.cr8.ai
sifuim.co
wachat.io
wassep.io
247987.com
8jours.top
ai.mprs.in
bee.cr8.ai
bot.aws.bj
bot.bbc.bj
cat.cr8.ai
ecombot.me
finplex.be
jxi.cr8.ai
linkz.chat
nepkit.com
pig.cr8.ai
re03tt.fun
sat.cr8.ai
typebot.io
wachats.me
wsapio.com
zamrin.net
blogely.com
bot.aipr.kr
bot.kloo.me
broprio.com
bull.cr8.ai
chatjer.com
docs.cr8.ai
getyour.sbs
icon.cr8.ai
minipost.uk
mole.cr8.ai
nurraysa.me
rebotica.ru
rideaway.io
saas.yachts
sacnext.com
team.cr8.ai
triprint.my
wolf.cr8.ai
ai.meant.com
test.reventepro.com
typebot.stillio.app
typebot.stillio.com
vg.onewebcenter.com
wa.onewebcenter.com
web.draleticiah.com
whatsdigital.online
wordsandimagery.com
88584434.therpm.club
92109660.therpm.club
app.horadelucrar.com
app.whatisappweb.com
aprendendojuntos.app
viewer-v2-typebot-io.vercel.app
mdb.assessoria.mauricio.progenbr.com
mdb.evento.autocadastro.progenbr.com
form.shopmercedesbenzsouthorlando.com
mdb.evento.equipeinterna.progenbr.com
bot.studiotecnicoimmobiliaremerelli.it
mdb.assessoria.boaventura.progenbr.com
mdb.assessoria.jtrebesqui.progenbr.com
pesquisa.escolamodacomproposito.com.br
anamnese.clinicaramosodontologia.com.br
gabinete.baleia.formulario.progenbr.com
mdb.assessoria.carreirinha.progenbr.com
chrome-os-inquiry-system.itschromeos.com
mdb.assessoria.paulomarques.progenbr.com
viewer-v2-git-main-typebot-io.vercel.app
main-menu-for-itschromeos.itschromeos.com
mdb.assessoria.qrcode.ademir.progenbr.com
mdb.assessoria.qrcode.arthur.progenbr.com
mdb.assessoria.qrcode.danilo.progenbr.com
mdb.assessoria.qrcode.marcao.progenbr.com
mdb.assessoria.qrcode.marcio.progenbr.com
mdb.assessoria.qrcode.aloisio.progenbr.com
mdb.assessoria.qrcode.girotto.progenbr.com
mdb.assessoria.qrcode.marinho.progenbr.com
mdb.assessoria.qrcode.rodrigo.progenbr.com
mdb.assessoria.carlosalexandre.progenbr.com
mdb.assessoria.qrcode.desideri.progenbr.com
mdb.assessoria.qrcode.fernanda.progenbr.com
mdb.assessoria.qrcode.jbatista.progenbr.com
mdb.assessoria.qrcode.mauricio.progenbr.com
mdb.assessoria.fernanda.regional.progenbr.com
mdb.assessoria.qrcode.boaventura.progenbr.com
mdb.assessoria.qrcode.jtrebesqui.progenbr.com
mdb.assessoria.qrcode.carreirinha.progenbr.com
mdb.assessoria.qrcode.paulomarques.progenbr.com
mdb.assessoria.qrcode.carlosalexandre.progenbr.com
mdb.assessoria.qrcode.fernanda.regional.progenbr.com

Please sign in to comment.