diff --git a/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts b/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts index a54ad2b995b..857ca025002 100644 --- a/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts +++ b/apps/viewer/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts @@ -132,13 +132,15 @@ export const executeWebhook = resultValues, groupId, }) - const { data: body, isJson } = bodyContent - ? safeJsonParse( - parseVariables(variables, { - escapeForJson: !checkIfBodyIsAVariable(bodyContent), - })(bodyContent) - ) - : { data: undefined, isJson: false } + const { data: body, isJson } = + bodyContent && webhook.method !== HttpMethod.GET + ? safeJsonParse( + parseVariables(variables, { + escapeForJson: !checkIfBodyIsAVariable(bodyContent), + })(bodyContent) + ) + : { data: undefined, isJson: false } + const request = { url: parseVariables(variables)( webhook.url + (queryParams !== '' ? `?${queryParams}` : '') @@ -151,8 +153,7 @@ export const executeWebhook = ? body : undefined, form: contentType === 'x-www-form-urlencoded' && body ? body : undefined, - body: - body && !isJson && webhook.method !== HttpMethod.GET ? body : undefined, + body: body && !isJson ? body : undefined, } try { const response = await got(request.url, omit(request, 'url')) diff --git a/packages/utils/package.json b/packages/utils/package.json index 5b6c52d7cba..88052820389 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -12,16 +12,16 @@ }, "devDependencies": { "@rollup/plugin-commonjs": "22.0.2", - "@rollup/plugin-node-resolve": "^13.3.0", - "@rollup/plugin-typescript": "8.4.0", - "rollup": "2.78.1", + "@rollup/plugin-node-resolve": "^14.0.1", + "@rollup/plugin-typescript": "8.5.0", + "rollup": "2.79.0", "rollup-plugin-dts": "^4.2.2", "rollup-plugin-peer-deps-external": "^2.2.4", "tslib": "^2.4.0", - "typescript": "^4.8.2", - "aws-sdk": "2.1204.0", + "typescript": "^4.8.3", + "aws-sdk": "2.1213.0", "models": "workspace:*", - "next": "12.2.5" + "next": "12.3.0" }, "peerDependencies": { "aws-sdk": "^2.1152.0",