fix: handle plain month number in attendance route, not just YYYY-MM
AttendanceAdmin sends ?year=YYYY&month=M (separate params), but the route handler assumed month was always in "YYYY-MM" format. When query.month was just "4", the split produced NaN for month and 4 for year, causing the service to skip 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.6.0",
|
||||
"version": "1.6.1",
|
||||
"description": "",
|
||||
"main": "dist/server.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -221,10 +221,16 @@ export default async function attendanceRoutes(
|
||||
isAdmin,
|
||||
authUserId: authData.userId,
|
||||
month: query.month
|
||||
? Number(String(query.month).split("-")[1])
|
||||
? String(query.month).includes("-")
|
||||
? Number(String(query.month).split("-")[1])
|
||||
: Number(query.month)
|
||||
: undefined,
|
||||
year: query.month
|
||||
? Number(String(query.month).split("-")[0])
|
||||
? String(query.month).includes("-")
|
||||
? Number(String(query.month).split("-")[0])
|
||||
: query.year
|
||||
? Number(query.year)
|
||||
: undefined
|
||||
: query.year
|
||||
? Number(query.year)
|
||||
: undefined,
|
||||
|
||||
Reference in New Issue
Block a user