Skip to content

Commit

Permalink
Merge pull request #232 from wizelineacademy/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
pedroalonsoms authored Jun 14, 2024
2 parents 0680557 + 1189aba commit f80e5e1
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions services/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,21 +196,22 @@ export async function getUserSkillsById(id: string) {
and(eq(userSkill.userId, id), eq(userSkill.kind, "AREA_OF_OPPORTUNITY")),
);

const strengthsSet = strengths.filter((s) => {
const set = new Set();
if (set.has(s.name)) return false;
set.add(s.name);
const strengthsSet = new Set();
const uniqueStrengths = strengths.filter((s) => {
if (strengthsSet.has(s.name)) return false;
strengthsSet.add(s.name);
return true;
});
const areasOppSet = areasOfOportunity.filter((s) => {
const set = new Set();
if (set.has(s.name)) return false;
set.add(s.name);

const areasOppSet = new Set();
const uniqueAreasOfOpportunity = areasOfOportunity.filter((s) => {
if (areasOppSet.has(s.name)) return false;
areasOppSet.add(s.name);
return true;
});
const traits = {
strengths: strengthsSet,
areasOfOportunity: areasOppSet,
strengths: uniqueStrengths,
areasOfOportunity: uniqueAreasOfOpportunity,
};
return traits;
}
Expand Down

0 comments on commit f80e5e1

Please sign in to comment.