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

Commit b6125dc

Browse files
committed
Extract skillProviderId instead of skill.id
1 parent 9a91748 commit b6125dc

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

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)

src/modules/search/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
},
1717
'/search/skills': {
1818
get: {
19-
method: Controller.searchSkills
19+
method: Controller.searchSkills,
2020
auth: 'jwt',
2121
access: consts.AdminUser,
2222
scopes: ['create:userAttribute', 'all:userAttribute']

0 commit comments

Comments
 (0)