feat: update educationMapping structure for improved education level handling

This commit is contained in:
faisolavolut 2025-04-21 11:28:51 +07:00
parent 637556e335
commit 5db7e37e58
1 changed files with 22 additions and 16 deletions

View File

@ -7,22 +7,28 @@ export const findLastEducation = (
if (!Array.isArray(userEducation) || userEducation.length === 0) { if (!Array.isArray(userEducation) || userEducation.length === 0) {
return null; // Jika array kosong, kembalikan null return null; // Jika array kosong, kembalikan null
} }
const educationMapping: Record<string, string[]> = {
const educationMapping: Record<string, string | string[]> = { SD: ["8 - Elementary School", "SD"],
SD: "8 - Elementary School", "SD 小学": ["8 - Elementary School", "SD"],
"SD 小学": "8 - Elementary School", SLTP: ["10 - Junior High School", "SMP"],
SLTP: "10 - Junior High School", "SLTP 中学": ["10 - Junior High School", "SMP"],
"SLTP 中学": "10 - Junior High School", SLTA: ["9 - Senior High School", "SMA"],
SLTA: "9 - Senior High School", "SLTA 高学": ["9 - Senior High School", "SMA"],
"SLTA 高学": "9 - Senior High School", "D 1": ["4 - Diploma 1", "D1"],
"D 1": "4 - Diploma 1", "D 2": ["5 - Diploma 2", "D2"],
"D 2": "5 - Diploma 2", "D 3": ["6 - Diploma 3", "D3"],
"D 3": "6 - Diploma 3", "D 1/2/3": [
"D 1/2/3": ["4 - Diploma 1", "5 - Diploma 2", "6 - Diploma 3"], // Cari D1/D2/D3 tertinggi & terbaru "4 - Diploma 1",
S1: ["3 - Bachelor", "7 - Diploma 4"], // S1 setara dengan D4 "5 - Diploma 2",
S2: "2 - Master Degree", "6 - Diploma 3",
"S2 研究": "2 - Master Degree", "D1",
S3: "1 - Doctoral / Professor", "D2",
"D3",
],
S1: ["3 - Bachelor", "7 - Diploma 4", "S1", "D4"],
S2: ["2 - Master Degree", "S2"],
"S2 研究": ["2 - Master Degree", "S2"],
S3: ["1 - Doctoral / Professor", "S3"],
}; };
const mappedValue = educationMapping[searchTerm]; const mappedValue = educationMapping[searchTerm];