@@ -245,7 +245,7 @@ function encodeQueryString (queryObj, nesting = '') {
245
245
* @returns {String } user id.
246
246
*/
247
247
async function getUserIds ( userId ) {
248
- const token = await getM2MToken ( )
248
+ const token = await getM2MUbahnToken ( )
249
249
const q = {
250
250
enrich : true ,
251
251
externalProfile : {
@@ -369,7 +369,7 @@ async function getTopcoderUserById (userId) {
369
369
* @returns the request result
370
370
*/
371
371
async function getUserById ( userId , enrich ) {
372
- const token = await getM2MToken ( )
372
+ const token = await getM2MUbahnToken ( )
373
373
const res = await request
374
374
. get ( `${ config . TC_API } /users/${ userId } ` + ( enrich ? '?enrich=true' : '' ) )
375
375
. set ( 'Authorization' , `Bearer ${ token } ` )
@@ -482,7 +482,7 @@ async function getProjectById (currentUser, id) {
482
482
* @returns the request result
483
483
*/
484
484
async function getTopcoderSkills ( criteria ) {
485
- const token = await getM2MToken ( )
485
+ const token = await getM2MUbahnToken ( )
486
486
try {
487
487
const res = await request
488
488
. get ( `${ config . TC_API } /skills` )
@@ -514,7 +514,7 @@ async function getTopcoderSkills (criteria) {
514
514
* @returns the request result
515
515
*/
516
516
async function getSkillById ( skillId ) {
517
- const token = await getM2MToken ( )
517
+ const token = await getM2MUbahnToken ( )
518
518
const res = await request
519
519
. get ( `${ config . TC_API } /skills/${ skillId } ` )
520
520
. set ( 'Authorization' , `Bearer ${ token } ` )
@@ -524,28 +524,6 @@ async function getSkillById (skillId) {
524
524
return _ . pick ( res . body , [ 'id' , 'name' ] )
525
525
}
526
526
527
- /**
528
- * Function to get user skills
529
- * @param {String } token the user request token
530
- * @param {String } userId user id
531
- * @returns the request result
532
- */
533
- async function getUserSkill ( token , userId ) {
534
- const url = `${ config . TC_API } /users/${ userId } /skills`
535
- const res = await request
536
- . get ( url )
537
- . set ( 'Authorization' , token )
538
- . set ( 'Content-Type' , 'application/json' )
539
- . set ( 'Accept' , 'application/json' )
540
- localLogger . debug ( { context : 'getUserSkill' , message : `response body: ${ JSON . stringify ( res . body ) } ` } )
541
- return _ . map ( res . body , item => {
542
- return {
543
- id : item . id ,
544
- name : item . skill . name
545
- }
546
- } )
547
- }
548
-
549
527
/**
550
528
* Encapsulate the getUserId function.
551
529
* Make sure a user exists in ubahn(/v5/users) and return the id of the user.
@@ -587,7 +565,7 @@ async function ensureJobById (jobId) {
587
565
* @returns {Object } the user data
588
566
*/
589
567
async function ensureUserById ( userId ) {
590
- const token = await getM2MToken ( )
568
+ const token = await getM2MUbahnToken ( )
591
569
try {
592
570
const res = await request
593
571
. get ( `${ config . TC_API } /users/${ userId } ` )
@@ -660,7 +638,6 @@ module.exports = {
660
638
getProjectById,
661
639
getTopcoderSkills,
662
640
getSkillById,
663
- getUserSkill,
664
641
ensureJobById,
665
642
ensureUserById,
666
643
getAuditM2Muser,
0 commit comments