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 <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-04-29 09:29:47 +02:00
parent e96e51598a
commit 746d17e182
2 changed files with 9 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "app-ts", "name": "app-ts",
"version": "1.5.8", "version": "1.5.9",
"description": "", "description": "",
"main": "dist/server.js", "main": "dist/server.js",
"scripts": { "scripts": {

View File

@@ -220,8 +220,14 @@ export default async function attendanceRoutes(
userId, userId,
isAdmin, isAdmin,
authUserId: authData.userId, authUserId: authData.userId,
month: query.month ? Number(query.month) : undefined, month: query.month
year: query.year ? Number(query.year) : undefined, ? 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({ return reply.send({