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