From 746d17e182602acc317e17a5fab79af3fb0f980e Mon Sep 17 00:00:00 2001 From: BOHA Date: Wed, 29 Apr 2026 09:29:47 +0200 Subject: [PATCH] fix: parse YYYY-MM month filter correctly in attendance history The frontend sends month as "YYYY-MM" but the route handler was passing it through Number() which parsed only the year portion, causing the service to ignore the month filter entirely. Co-Authored-By: Claude Opus 4.7 --- package.json | 2 +- src/routes/admin/attendance.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index dbcd8fb..819dd6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app-ts", - "version": "1.5.8", + "version": "1.5.9", "description": "", "main": "dist/server.js", "scripts": { diff --git a/src/routes/admin/attendance.ts b/src/routes/admin/attendance.ts index 06b74bc..126d3cd 100644 --- a/src/routes/admin/attendance.ts +++ b/src/routes/admin/attendance.ts @@ -220,8 +220,14 @@ export default async function attendanceRoutes( userId, isAdmin, authUserId: authData.userId, - month: query.month ? Number(query.month) : undefined, - year: query.year ? Number(query.year) : undefined, + month: query.month + ? Number(String(query.month).split("-")[1]) + : undefined, + year: query.month + ? Number(String(query.month).split("-")[0]) + : query.year + ? Number(query.year) + : undefined, }); return reply.send({