diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e095a20..31a1e591 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,7 @@ install_dependency: &install_dependency sudo apt install jq sudo apt install python3-pip sudo pip3 install awscli --upgrade + sudo pip3 install docker==6.1.3 sudo pip3 install docker-compose install_deploysuite: &install_deploysuite name: Installation of install_deploysuite. @@ -91,6 +92,7 @@ workflows: only: - dev - CORE-40 + - TSJR-327 - "build-qa": context: org-global diff --git a/src/services/ChallengeService.js b/src/services/ChallengeService.js index 30d99f24..f17bf7c5 100644 --- a/src/services/ChallengeService.js +++ b/src/services/ChallengeService.js @@ -590,6 +590,24 @@ async function searchChallenges(currentUser, criteria) { }); } + const includedSkillIds = _.isArray(criteria.skillIds) ? criteria.skillIds : []; + + if (includedSkillIds.length > 0) { + const skillQuery=[] + + for (const skillId of includedSkillIds) { + const matchPhrase = {}; + matchPhrase[`skills.id`] = `${skillId}`; + skillQuery.push({"match_phrase":matchPhrase}) + } + boolQuery.push({ + bool:{ + should:skillQuery, + minimum_should_match: 1 + } + }) + } + // FIXME: Tech Debt let excludeTasks = true; // if you're an admin or m2m, security rules wont be applied @@ -881,6 +899,7 @@ searchChallenges.schema = { description: Joi.string(), timelineTemplateId: Joi.string(), // Joi.optionalId(), reviewType: Joi.string(), + skillIds: Joi.array().items(Joi.string()), tag: Joi.string(), tags: Joi.array().items(Joi.string()), includeAllTags: Joi.boolean().default(true),