Skip to content

Commit

Permalink
chore: move trengo from myaxios to httpget
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSudip committed Jun 10, 2024
1 parent e124470 commit 450f251
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/v0/destinations/trengo/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const {
InstrumentationError,
NetworkInstrumentationError,
} = require('@rudderstack/integrations-lib');
const myAxios = require('../../../util/myAxios');
const { EventType } = require('../../../constants');
const { EndPoints, BASE_URL } = require('./config');
const {
Expand All @@ -27,6 +26,7 @@ const {
const tags = require('../../util/tags');
const { getDynamicErrorType } = require('../../../adapters/utils/networkUtils');
const { JSON_MIME_TYPE } = require('../../util/constant');
const { httpGET } = require('../../../adapters/network');

/**
*
Expand Down Expand Up @@ -83,7 +83,7 @@ const validate = (email, phone, channelIdentifier) => {
const lookupContact = async (term, destination) => {
let res;
try {
res = await myAxios.get(
res = await httpGET(
`${BASE_URL}/contacts?page=1&term=${term}`,
{
headers: {
Expand All @@ -98,6 +98,7 @@ const lookupContact = async (term, destination) => {
module: 'router',
},
);
res = res.response;
} catch (err) {
// check if exists err.response && err.response.status else 500
const status = err.response?.status || 400;
Expand Down

0 comments on commit 450f251

Please sign in to comment.