diff --git a/packages/server/package.json b/packages/server/package.json index cf9a4fbd55..e1853c38d5 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -47,7 +47,6 @@ "@sendgrid/mail": "^7.1.1", "@sentry/node": "^5.19.2", "aws-sdk": "^2.767.0", - "axios": "^0.21.0", "bcryptjs": "^2.4.3", "chmodr": "^1.2.0", "csvtojson": "^2.0.10", diff --git a/packages/server/src/automations/steps/outgoingWebhook.js b/packages/server/src/automations/steps/outgoingWebhook.js index 989e4231f8..817ec424b2 100644 --- a/packages/server/src/automations/steps/outgoingWebhook.js +++ b/packages/server/src/automations/steps/outgoingWebhook.js @@ -1,4 +1,4 @@ -const axios = require("axios") +const fetch = require("node-fetch") const RequestType = { POST: "POST", @@ -71,20 +71,19 @@ module.exports.run = async function({ inputs }) { } const request = { method: requestMethod, - url, } if ( requestBody && requestBody.length !== 0 && BODY_REQUESTS.indexOf(requestMethod) !== -1 ) { - request.data = JSON.parse(requestBody) + request.body = JSON.parse(requestBody) } try { - const response = await axios(request) + const response = await fetch(url, request) return { - response: response.data, + response: await response.json(), success: response.status === 200, } } catch (err) {