Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 5f2171a

Browse files
Merge pull request #27 from ansaryfantastic/develop
Extract skillProviderId from organization.skills
2 parents f15e796 + b6125dc commit 5f2171a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

docs/UBahn_API.postman_collection.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,13 @@
143143
}
144144
],
145145
"url": {
146-
"raw": "{{HOST}}/search/userAchievements?organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad&keyword=Topcoder",
146+
"raw": "{{HOST}}/search/skills?organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad&keyword=net",
147147
"host": [
148148
"{{HOST}}"
149149
],
150150
"path": [
151151
"search",
152-
"userAchievements"
152+
"skills"
153153
],
154154
"query": [
155155
{
@@ -158,7 +158,7 @@
158158
},
159159
{
160160
"key": "keyword",
161-
"value": "Topcoder"
161+
"value": "net"
162162
}
163163
]
164164
}

src/common/es-helper.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,15 +1436,14 @@ async function searchUsers (authUser, filter, params) {
14361436
* Search for skills matching the given keyword and are part of the given organization
14371437
* @param {Object} param0 the organizationId and keyword
14381438
*/
1439-
14401439
async function searchSkillsInOrganization ({ organizationId, keyword }) {
14411440
const esQueryToGetSkillProviders = buildEsQueryToGetSkillProviderIds(organizationId)
14421441
logger.debug(`ES query to get skill provider ids: ${JSON.stringify(esQueryToGetSkillProviders, null, 2)}`)
14431442

14441443
const esResultOfQueryToGetSkillProviders = await esClient.search(esQueryToGetSkillProviders)
14451444
logger.debug(`ES result: ${JSON.stringify(esResultOfQueryToGetSkillProviders, null, 2)}`)
14461445

1447-
const skillProviderIds = _.flatten(esResultOfQueryToGetSkillProviders.hits.hits.map(hit => hit._source.skillProviders == null ? [] : hit._source.skillProviders.map(sp => sp.id)))
1446+
const skillProviderIds = _.flatten(esResultOfQueryToGetSkillProviders.hits.hits.map(hit => hit._source.skillProviders == null ? [] : hit._source.skillProviders.map(sp => sp.skillProviderId)))
14481447
logger.debug(`Organization ${organizationId} yielded skillProviderIds: ${JSON.stringify(skillProviderIds, null, 2)}`)
14491448

14501449
const skills = await searchSkills(keyword, skillProviderIds)

0 commit comments

Comments
 (0)