upd: api tahun

Deskripsi:
- update api mobile filter tahun pada fitur divisi tugas

No Issues
This commit is contained in:
2026-02-03 12:24:23 +08:00
parent fa9b883c2e
commit f5e36f5ac7
2 changed files with 17 additions and 6 deletions

View File

@@ -35,7 +35,13 @@ export async function GET(request: Request) {
// (opsional) urutkan dari terbaru ke lama
uniqueYears.sort((a, b) => b - a);
const formattedData = uniqueYears.map(year => ({
id: String(year),
name: String(year)
}));
return NextResponse.json({ success: true, message: "Success", data: uniqueYears }, { status: 200 });
return NextResponse.json({ success: true, message: "Success", data: formattedData }, { status: 200 });
}