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

Commit c375bb5

Browse files
committed
fix: cannot find name for job skill
ref issue #103
1 parent 9907a4f commit c375bb5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/routes/JobDetails/index.jsx

+11-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,19 @@ const JobDetails = ({ teamId, jobId }) => {
3131
if (!!skills && !!job) {
3232
setSkillSet(
3333
job.skills
34-
?.map((val) => {
35-
const skill = skills.find((sk) => sk.id === val);
34+
// map skill ids to names
35+
?.map((skillId) => {
36+
const skill = _.find(skills, { id: skillId });
37+
38+
if (!skill) {
39+
console.warn(`Couldn't find name for skill id "${skillId}" of the job "${job.id}".`)
40+
return null
41+
}
42+
3643
return skill.name;
3744
})
45+
// remove `null` values for skills when we couldn't find the name
46+
.filter((skillName) => !!skillName)
3847
.join(", ")
3948
);
4049
}

0 commit comments

Comments
 (0)