Skip to content

Commit 4baf155

Browse files
committed
feat: use "skilliD" for job creation
1 parent cccb677 commit 4baf155

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/events/projects/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,13 @@ async function projectCreatedKafkaHandler(app, topic, payload) {
203203
(specialist) => {
204204
const startDate = new Date();
205205
const endDate = moment(startDate).add(Number(specialist.duration), 'M'); // the unit of duration is month
206-
// use both, required and additional skills for jobs
207-
const skills = specialist.skills.concat(specialist.additionalSkills)
208-
// only include skills with `id` and ignore custom skills in jobs
209-
.filter(skill => skill.id).map(skill => skill.id);
206+
// make sure that skills would be unique in the list
207+
const skills = _.uniq(
208+
// use both, required and additional skills for jobs
209+
specialist.skills.concat(specialist.additionalSkills)
210+
// only include skills with `skillId` and ignore custom skills in jobs
211+
.filter(skill => skill.skillId).map(skill => skill.skillId),
212+
);
210213
return createTaasJob({
211214
projectId: project.id,
212215
externalId: '0', // hardcode for now

0 commit comments

Comments
 (0)