Skip to content

Commit 7913220

Browse files
committed
update logic for changed api response from identity service
1 parent ccfcc6e commit 7913220

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

config/development.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"copilotPortalUrl": "https://copilots.topcoder-dev.com",
77
"fileServiceEndpoint": "https://api.topcoder-dev.com/v5/files",
88
"memberServiceEndpoint": "https://api.topcoder-dev.com/v5/members",
9-
"identityServiceEndpoint": "https://api.topcoder-dev.com/v3/",
9+
"identityServiceEndpoint": "https://api.topcoder-dev.com/v6/",
1010
"taasJobApiUrl": "https://api.topcoder-dev.com/v5/jobs",
1111
"sfdcBillingAccountNameField": "Billing_Account_name__c",
1212
"sfdcBillingAccountMarkupField": "Mark_Up__c",

src/util.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -820,10 +820,10 @@ const projectServiceUtils = {
820820
const token = yield this.getM2MToken();
821821
const httpClient = this.getHttpClient({ id: requestId, log: logger });
822822
httpClient.defaults.timeout = 6000;
823-
logger.debug(`${config.identityServiceEndpoint}roles/${roleId}`, "fetching role info");
823+
logger.debug(`${config.identityServiceEndpoint}roles/${roleId}`, 'fetching role info');
824824
return httpClient.get(`${config.identityServiceEndpoint}roles/${roleId}`, {
825825
params: {
826-
fields: `subjects`,
826+
fields: 'subjects',
827827
},
828828
headers: {
829829
'Content-Type': 'application/json',
@@ -834,7 +834,7 @@ const projectServiceUtils = {
834834
return _.get(res, 'data.result.content', []);
835835
});
836836
} catch (err) {
837-
logger.debug(err, "error on getting role info");
837+
logger.debug(err, 'error on getting role info');
838838
return Promise.reject(err);
839839
}
840840
}),
@@ -853,8 +853,9 @@ const projectServiceUtils = {
853853
Authorization: `Bearer ${token}`,
854854
},
855855
}).then((res) => {
856-
logger.debug(`Roles by ${roleName}: ${JSON.stringify(res.data.result.content)}`);
857-
return _.get(res, 'data.result.content', [])
856+
const roles = res.data;
857+
logger.debug(`Roles by ${roleName}: ${JSON.stringify(roles)}`);
858+
return roles
858859
.filter(item => item.roleName === roleName)
859860
.map(r => r.id);
860861
});

0 commit comments

Comments
 (0)