testing yuk
This commit is contained in:
@@ -38,7 +38,7 @@ export async function GET(request: Request) {
|
||||
);
|
||||
}
|
||||
|
||||
// Group by tahun_angkatan, nama_kelompok
|
||||
// Kelompokkan berdasarkan tahun_angkatan, nama_kelompok
|
||||
const groupedData = data.reduce((acc, item: any) => {
|
||||
const tahun_angkatan = item.tahun_angkatan;
|
||||
const nama_kelompok = item.kelompok_keahlian?.nama_kelompok;
|
||||
@@ -47,7 +47,7 @@ export async function GET(request: Request) {
|
||||
return acc;
|
||||
}, {} as Record<string, number>);
|
||||
|
||||
// Convert to final format and sort
|
||||
// Konversi ke format akhir dan urutkan
|
||||
const results: KelompokKeahlianStatus[] = Object.entries(groupedData)
|
||||
.map(([key, jumlah_mahasiswa]) => {
|
||||
const [tahun_angkatan, nama_kelompok] = key.split('-');
|
||||
@@ -58,7 +58,7 @@ export async function GET(request: Request) {
|
||||
};
|
||||
})
|
||||
.sort((a, b) => {
|
||||
// Sort by tahun_angkatan ASC, nama_kelompok ASC
|
||||
// Urutkan berdasarkan tahun_angkatan ASC, nama_kelompok ASC
|
||||
if (a.tahun_angkatan !== b.tahun_angkatan) {
|
||||
return a.tahun_angkatan - b.tahun_angkatan;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user