Skip to content

Commit 216c256

Browse files
committed
clear unnecessary function call
1 parent ae782d5 commit 216c256

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

src/services/TeamService.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -764,9 +764,7 @@ async function roleSearchRequest (currentUser, data) {
764764
} else {
765765
// if only job description is provided, collect skill names from description
766766
const tags = await getSkillsByJobDescription(currentUser, { description: data.jobDescription })
767-
// collected tags from description has inconsistency with topcoder skills
768-
// we need to filter invalid skills
769-
const skills = await getSkillNamesByNames(_.map(tags, 'tag'))
767+
const skills = _.map(tags, 'tag')
770768
// find the best matching role
771769
role = await getRoleBySkills(skills)
772770
}
@@ -930,27 +928,6 @@ getSkillIdsByNames.schema = Joi.object()
930928
skills: Joi.array().items(Joi.string().required()).required()
931929
}).required()
932930

933-
/**
934-
* Filters invalid skills from given skill names
935-
*
936-
* @param {Array<string>} skills the array of skill names
937-
* @returns {Array<string>} the array of skill names
938-
*/
939-
async function getSkillNamesByNames (skills) {
940-
// remove duplicates, leading and trailing whitespaces, empties.
941-
const cleanedSkills = _.uniq(_.filter(_.map(skills, skill => _.trim(skill)), skill => !_.isEmpty(skill)))
942-
const result = await helper.getAllTopcoderSkills({ name: _.join(cleanedSkills, ',') })
943-
const skillNames = _.map(result, 'name')
944-
// endpoint returns the partial matched skills
945-
// we need to filter by exact match case insensitive
946-
return _.intersectionBy(skillNames, cleanedSkills, _.toLower)
947-
}
948-
949-
getSkillNamesByNames.schema = Joi.object()
950-
.keys({
951-
skills: Joi.array().items(Joi.string().required()).required()
952-
}).required()
953-
954931
/**
955932
* Creates the role search request
956933
*
@@ -1156,7 +1133,6 @@ module.exports = {
11561133
getSkillsByJobDescription,
11571134
getSkillNamesByIds,
11581135
getSkillIdsByNames,
1159-
getSkillNamesByNames,
11601136
createRoleSearchRequest,
11611137
isExternalMember,
11621138
createTeam,

0 commit comments

Comments
 (0)