Skip to content

Commit 2b6ccdb

Browse files
committed
Revert "feat: endpoint to get V5 user by handle"
This reverts commit 2b7a591.
1 parent 7c001bc commit 2b6ccdb

File tree

5 files changed

+4
-94
lines changed

5 files changed

+4
-94
lines changed

docs/Topcoder-bookings-api.postman_collection.json

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"info": {
3-
"_postman_id": "0c096a43-08c8-4152-83ca-1d544f92cad4",
3+
"_postman_id": "b1144d77-699c-47be-864e-fbe99e7f5c14",
44
"name": "Topcoder-bookings-api",
55
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
66
},
@@ -4431,37 +4431,6 @@
44314431
}
44324432
},
44334433
"response": []
4434-
},
4435-
{
4436-
"name": "GET /taas-teams/users/:handle",
4437-
"request": {
4438-
"method": "GET",
4439-
"header": [
4440-
{
4441-
"key": "Authorization",
4442-
"type": "text",
4443-
"value": "Bearer {{token_member}}"
4444-
}
4445-
],
4446-
"url": {
4447-
"raw": "{{URL}}/taas-teams/users/:handle",
4448-
"host": [
4449-
"{{URL}}"
4450-
],
4451-
"path": [
4452-
"taas-teams",
4453-
"users",
4454-
":handle"
4455-
],
4456-
"variable": [
4457-
{
4458-
"key": "handle",
4459-
"value": "pshah_customer"
4460-
}
4461-
]
4462-
}
4463-
},
4464-
"response": []
44654434
}
44664435
]
44674436
},

src/common/helper.js

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -440,26 +440,6 @@ async function getMembers (handles) {
440440
return res.body
441441
}
442442

443-
/**
444-
* Get Topcoder Member by handle
445-
*
446-
* @param {String} handle user handle
447-
*
448-
* @returns the request result
449-
*/
450-
async function getMemberByHandle (handle) {
451-
const token = await getM2MToken()
452-
const url = `${config.TC_API}/members/${handle}`
453-
454-
const res = await request
455-
.get(url)
456-
.set('Authorization', `Bearer ${token}`)
457-
.set('Content-Type', 'application/json')
458-
.set('Accept', 'application/json')
459-
localLogger.debug({ context: 'getMemberByHandle', message: `handle: "${handle}", response body: ${JSON.stringify(res.body)}` })
460-
return res.body
461-
}
462-
463443
/**
464444
* Function to get project by id
465445
* @param {Object} currentUser the user who perform this operation
@@ -661,6 +641,5 @@ module.exports = {
661641
ensureJobById,
662642
ensureUserById,
663643
getAuditM2Muser,
664-
checkIsMemberOfProject,
665-
getMemberByHandle
644+
checkIsMemberOfProject
666645
}

src/controllers/SkillController.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@ async function searchSkills (req, res) {
1515
res.send(result.result)
1616
}
1717

18-
/**
19-
* Get V5 U-bahn user by handle
20-
* If user doesn't exists in V5 it creates it
21-
*
22-
* @param req the request
23-
* @param res the response
24-
*/
25-
async function getUserByHandle (req, res) {
26-
res.send(await service.getUserByHandle(req.params.handle))
27-
}
28-
2918
module.exports = {
30-
searchSkills,
31-
getUserByHandle
19+
searchSkills
3220
}

src/routes/TeamRoutes.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ module.exports = {
2020
scopes: [constants.Scopes.READ_TAAS_TEAM]
2121
}
2222
},
23-
'/taas-teams/users/:handle': {
24-
get: {
25-
controller: 'SkillController',
26-
method: 'getUserByHandle',
27-
auth: 'jwt',
28-
scopes: [constants.Scopes.READ_TAAS_TEAM]
29-
}
30-
},
3123
'/taas-teams/:id': {
3224
get: {
3325
controller: 'TeamController',

src/services/SkillService.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,6 @@ searchSkills.schema = Joi.object().keys({
2121
}).required()
2222
}).required()
2323

24-
/**
25-
* Get V5 U-bahn user by handle
26-
* If user doesn't exists in V5 it creates it
27-
*
28-
* @param {Object} handle user handle
29-
*
30-
* @returns {Object} V5 user
31-
*/
32-
async function getUserByHandle(handle) {
33-
const v3User = await helper.getMemberByHandle(handle);
34-
const v5userId = await helper.getUserId(v3User.userId);
35-
36-
return {
37-
userId: v5userId
38-
};
39-
}
40-
4124
module.exports = {
42-
searchSkills,
43-
getUserByHandle,
25+
searchSkills
4426
}

0 commit comments

Comments
 (0)