From e681826411749638bd968f14807a6d7f9c323436 Mon Sep 17 00:00:00 2001 From: eveeifyeve <88671402+Eveeifyeve@users.noreply.github.com> Date: Sat, 4 Jan 2025 23:34:05 +1100 Subject: [PATCH] fix: format of icons. --- src/pages/api/skillIcon.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/pages/api/skillIcon.ts b/src/pages/api/skillIcon.ts index 9ab1280..93eda0b 100644 --- a/src/pages/api/skillIcon.ts +++ b/src/pages/api/skillIcon.ts @@ -2,15 +2,11 @@ import json from "../../data/skills.json"; export async function GET() { try { - const response = json; - const skills: Set = new Set(); - - Object.entries(response).forEach(([_, categoryData]) => { - Object.values(categoryData).forEach(item => { - const skillIcon = (item)?.skillIcon ?? ''; - skills.add(skillIcon); - }); - }); + const skills: Array = []; + json.languages.forEach(item => skills.push(item.skillIcon)) + json.tools.forEach(item => skills.push(item.skillIcon)) + json.database.forEach(item => skills.push(item.skillIcon)) + json.other.forEach(item => skills.push(item.skillIcon)) const combinedSkills: string[] = Array.from(skills).sort();