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:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "app-ts",
|
||||
"version": "1.5.8",
|
||||
"version": "1.5.9",
|
||||
"description": "",
|
||||
"main": "dist/server.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user