Skip to content

Commit 33b79fe

Browse files
committed
Ensure that the startDate and endDate query params for /stats/days actually get passed in
1 parent 1bf4d07 commit 33b79fe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Types of changes include:
1313
## Upcoming/Unreleased
1414

1515
- FIXED: Bar chart tooltips now show up where they ought to, instead of slightly above that day's bar. The tooltips are now once again at the top of the bars as well. Hopefully this is the last fix to bar charts for a while! (h/t Amaras)
16+
- FIXED: The `startDate` and `endDate` query parameters for the `GET /api/v1/stats/days` API endpoint now actually filter the results. (h/t Preocts)
1617

1718
## 1.4.6
1819

server/api/v1/stats.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ const zDaysQuery = z.object({
2828
export type DaysQuery = z.infer<typeof zDaysQuery>;
2929

3030
export async function handleGetDays(req: RequestWithUser, res: ApiResponse<DayCount[]>) {
31-
const dayCounts = await getDayCounts(req.user.id);
31+
const query = req.query as DaysQuery;
32+
33+
const dayCounts = await getDayCounts(req.user.id, query.startDate, query.endDate);
3234

3335
return res.status(200).send(success(dayCounts));
3436
}

0 commit comments

Comments
 (0)