Skip to content

Commit

Permalink
chore: code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mihir-4116 committed Sep 26, 2023
1 parent c619099 commit fe15ecc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions src/v0/destinations/intercom/deleteUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const userDeletionHandler = async (userAttributes, config) => {
if (!config) {
throw new ConfigurationError('Config for deletion not present');
}
const { apiKey } = config;
if (!apiKey) {
throw new ConfigurationError('api key for deletion not present');
const { accessToken } = config;
if (!accessToken) {
throw new ConfigurationError('access token for deletion not present');
}
const validUserIds = [];
userAttributes.forEach((userAttribute) => {
Expand All @@ -31,7 +31,7 @@ const userDeletionHandler = async (userAttributes, config) => {
};
const requestOptions = {
headers: {
Authorization: `Bearer ${apiKey}`,
Authorization: `Bearer ${accessToken}`,
Accept: JSON_MIME_TYPE,
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/v0/destinations/intercom/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const validateTrack = (payload) => {
*/
const getHeaders = (destination) => ({
'Content-Type': JSON_MIME_TYPE,
Authorization: `Bearer ${destination.Config.apiKey}`,
Authorization: `Bearer ${destination.Config.accessToken}`,
Accept: JSON_MIME_TYPE,
'Intercom-Version': '2.10',
});
Expand Down
24 changes: 12 additions & 12 deletions test/__tests__/data/intercom.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"destination": {
"Config": {
"apiKey": "ABC..."
"accessToken": "ABC..."
}
},
"metadata": {
Expand Down Expand Up @@ -55,7 +55,7 @@
},
"destination": {
"Config": {
"apiKey": "ABC..."
"accessToken": "ABC..."
}
}
},
Expand Down Expand Up @@ -84,7 +84,7 @@
},
"destination": {
"Config": {
"apiKey": "ABC..."
"accessToken": "ABC..."
}
}
},
Expand Down Expand Up @@ -160,7 +160,7 @@
},
"destination": {
"Config": {
"apiKey": "dummyApiKey",
"accessToken": "dummyaccessToken",
"apiServer": "standard"
}
}
Expand Down Expand Up @@ -192,7 +192,7 @@
"files": {},
"headers": {
"Accept": "application/json",
"Authorization": "Bearer dummyApiKey",
"Authorization": "Bearer dummyaccessToken",
"Content-Type": "application/json",
"Intercom-Version": "2.10"
},
Expand Down Expand Up @@ -267,7 +267,7 @@
},
"destination": {
"Config": {
"apiKey": "dummyApiKey",
"accessToken": "dummyaccessToken",
"apiServer": "standard",
"sendAnonymousId": true
}
Expand Down Expand Up @@ -300,7 +300,7 @@
"files": {},
"headers": {
"Accept": "application/json",
"Authorization": "Bearer dummyApiKey",
"Authorization": "Bearer dummyaccessToken",
"Content-Type": "application/json",
"Intercom-Version": "2.10"
},
Expand Down Expand Up @@ -384,7 +384,7 @@
},
"destination": {
"Config": {
"apiKey": "dummyApiKey",
"accessToken": "dummyaccessToken",
"apiServer": "eu",
"sendAnonymousId": true
}
Expand Down Expand Up @@ -469,7 +469,7 @@
},
"destination": {
"Config": {
"apiKey": "dummyApiKey",
"accessToken": "dummyaccessToken",
"apiServer": "au",
"sendAnonymousId": true
}
Expand Down Expand Up @@ -501,7 +501,7 @@
"files": {},
"headers": {
"Accept": "application/json",
"Authorization": "Bearer dummyApiKey",
"Authorization": "Bearer dummyaccessToken",
"Content-Type": "application/json",
"Intercom-Version": "2.10"
},
Expand Down Expand Up @@ -537,7 +537,7 @@
},
"destination": {
"Config": {
"apiKey": "dummyApiKey",
"accessToken": "dummyaccessToken",
"apiServer": "standard",
"sendAnonymousId": true
}
Expand All @@ -556,7 +556,7 @@
"files": {},
"headers": {
"Accept": "application/json",
"Authorization": "Bearer dummyApiKey",
"Authorization": "Bearer dummyaccessToken",
"Content-Type": "application/json",
"Intercom-Version": "2.10"
},
Expand Down

0 comments on commit fe15ecc

Please sign in to comment.