Skip to content

Commit

Permalink
fix(engine): πŸš‘οΈ Webhook return func
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Apr 1, 2022
1 parent db10f1e commit 3585e63
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/builder/components/shared/VariableSearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const VariableSearchInput = ({

const handleCreateNewVariableClick = () => {
if (!inputValue || inputValue === '') return
const id = cuid()
const id = 'v' + cuid()
onSelectVariable({ id, name: inputValue })
createVariable({ id, name: inputValue })
onClose()
Expand Down
6 changes: 3 additions & 3 deletions apps/builder/public/templates/customer-support.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"button": "Send",
"placeholder": "Describe the bug..."
},
"variableId": "51BcuecnB6kRU1tsttaGyR"
"variableId": "v51BcuecnB6kRU1tsttaGyR"
},
"outgoingEdgeId": "cl1571jhh00022e6dk77f52wg"
}
Expand Down Expand Up @@ -258,7 +258,7 @@
"button": "Send",
"placeholder": "Type your answer..."
},
"variableId": "51BcuecnB6kRU1tsttaGyR"
"variableId": "v51BcuecnB6kRU1tsttaGyR"
},
"outgoingEdgeId": "cl1571ktd00032e6dyti22850"
}
Expand Down Expand Up @@ -368,7 +368,7 @@
],
"variables": [
{ "id": "t2k6cj3uYfNdJX13APA4b9", "name": "Email" },
{ "id": "51BcuecnB6kRU1tsttaGyR", "name": "Content" }
{ "id": "v51BcuecnB6kRU1tsttaGyR", "name": "Content" }
],
"edges": [
{
Expand Down
4 changes: 2 additions & 2 deletions apps/builder/public/templates/lead-gen.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"blockId": "o4SH1UtKANnW5N5D67oZUz",
"options": {
"labels": { "button": "Send", "placeholder": "Type your email..." },
"variableId": "3VFChNVSCXQ2rXv4DrJ8Ah"
"variableId": "v3VFChNVSCXQ2rXv4DrJ8Ah"
},
"outgoingEdgeId": "w3MiN1Ct38jT5NykVsgmb5"
}
Expand Down Expand Up @@ -276,7 +276,7 @@
],
"variables": [
{ "id": "giiLFGw5xXBCHzvp1qAbdX", "name": "Name" },
{ "id": "3VFChNVSCXQ2rXv4DrJ8Ah", "name": "Email" }
{ "id": "v3VFChNVSCXQ2rXv4DrJ8Ah", "name": "Email" }
],
"edges": [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/bot-engine/src/services/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const executeWebhook = async (
const existingVariable = variables.find(byId(varMapping.variableId))
if (!existingVariable) return newVariables
const func = Function('data', `return data.${varMapping?.bodyPath}`)
const value = func(JSON.stringify(data))
const value = func(data)
updateVariableValue(existingVariable?.id, value)
return [...newVariables, { ...existingVariable, value }]
}, [])
Expand Down

4 comments on commit 3585e63

@vercel
Copy link

@vercel vercel bot commented on 3585e63 Apr 1, 2022

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 3585e63 Apr 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:

landing-page-v2 – ./apps/landing-page

www.get-typebot.com
get-typebot.com
typebot.io
landing-page-v2-typebot-io.vercel.app
landing-page-v2-git-main-typebot-io.vercel.app
www.typebot.io

@vercel
Copy link

@vercel vercel bot commented on 3585e63 Apr 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-git-main-typebot-io.vercel.app
app.typebot.io
builder-v2-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 3585e63 Apr 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:

viewer-v2-alpha – ./apps/viewer

viewer-v2-alpha-typebot-io.vercel.app
viewer-v2-alpha.vercel.app
viewer-v2-alpha-git-main-typebot-io.vercel.app

Please sign in to comment.