Skip to content

Commit 3c2e2cb

Browse files
committed
Add skills to roleSearchRequest when made by job description.
Ensures that custom roles can be added to newly created teams.
1 parent 8635479 commit 3c2e2cb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/services/TeamService.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,11 @@ async function roleSearchRequest (currentUser, data) {
771771
// if only job description is provided, collect skill names from description
772772
const tags = await getSkillsByJobDescription({ description: data.jobDescription })
773773
const skills = _.map(tags, 'tag')
774-
// find the best matching role
775-
role = await getRoleBySkills(skills)
774+
775+
// add skills to roleSearchRequest and get best matching role
776+
const [skillIds, roleList] = await Promise.all([getSkillIdsByNames(skills), getRoleBySkills(skills)])
777+
data.skills = skillIds
778+
role = roleList
776779
}
777780
data.roleId = role.id
778781
// create roleSearchRequest entity with found roleId

0 commit comments

Comments
 (0)