File tree 3 files changed +7
-5
lines changed
3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ module.exports = {
21
21
22
22
TC_API : process . env . TC_API || 'https://api.topcoder-dev.com/v5' ,
23
23
ORG_ID : process . env . ORG_ID || '36ed815b-3da1-49f1-a043-aaed0a4e81ad' ,
24
- TOPCODER_SKILL_PROVIDER_ID : process . env . TOPCODER_SKILL_PROVIDER_ID ,
24
+ TOPCODER_SKILL_PROVIDER_ID : process . env . TOPCODER_SKILL_PROVIDER_ID || '9cc0795a-6e12-4c84-9744-15858dba1861' ,
25
25
26
26
TOPCODER_USERS_API : process . env . TOPCODER_USERS_API || 'https://api.topcoder-dev.com/v3/users' ,
27
27
Original file line number Diff line number Diff line change @@ -475,10 +475,12 @@ async function getProjectById (currentUser, id) {
475
475
476
476
/**
477
477
* Function to search skills from v5/skills
478
+ * - only returns skills from Topcoder Skills Provider defined by `TOPCODER_SKILL_PROVIDER_ID`
479
+ *
478
480
* @param {Object } criteria the search criteria
479
481
* @returns the request result
480
482
*/
481
- async function getSkills ( criteria ) {
483
+ async function getTopcoderSkills ( criteria ) {
482
484
const token = await getM2Mtoken ( )
483
485
try {
484
486
const res = await request
@@ -490,7 +492,7 @@ async function getSkills (criteria) {
490
492
. set ( 'Authorization' , `Bearer ${ token } ` )
491
493
. set ( 'Content-Type' , 'application/json' )
492
494
. set ( 'Accept' , 'application/json' )
493
- localLogger . debug ( { context : 'getSkills ' , message : `response body: ${ JSON . stringify ( res . body ) } ` } )
495
+ localLogger . debug ( { context : 'getTopcoderSkills ' , message : `response body: ${ JSON . stringify ( res . body ) } ` } )
494
496
return {
495
497
total : Number ( _ . get ( res . headers , 'x-total' ) ) ,
496
498
page : Number ( _ . get ( res . headers , 'x-page' ) ) ,
@@ -623,7 +625,7 @@ module.exports = {
623
625
getUserById,
624
626
getMembers,
625
627
getProjectById,
626
- getSkills ,
628
+ getTopcoderSkills ,
627
629
getSkillById,
628
630
getUserSkill,
629
631
ensureJobById,
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const helper = require('../common/helper')
10
10
* @returns {Object } the search result, contain total/page/perPage and result array
11
11
*/
12
12
async function searchSkills ( criteria ) {
13
- return helper . getSkills ( criteria )
13
+ return helper . getTopcoderSkills ( criteria )
14
14
}
15
15
16
16
searchSkills . schema = Joi . object ( ) . keys ( {
You can’t perform that action at this time.
0 commit comments