From 2eee1a7c025a34da680d7cc399f0ea90256ece34 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Fri, 24 Apr 2026 11:57:07 +0100 Subject: [PATCH] fix: projects page shows all-time data, not just last 30 days When /api/dashboard/projects is called without date params (as the Projects page does), remove the date filter so all 36 projects appear regardless of last activity date. Explicit date params still filter as before (dashboard summary tab). Co-Authored-By: Claude Sonnet 4.6 --- src/routers/dashboard.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/routers/dashboard.py b/src/routers/dashboard.py index 5147b7f..43aa3fe 100644 --- a/src/routers/dashboard.py +++ b/src/routers/dashboard.py @@ -101,15 +101,17 @@ async def projects_overview( to_date: date | None = Query(default=None, alias="to"), db: AsyncSession = Depends(get_db), ): - from_date, to_date = _date_range(from_date, to_date) + date_clauses = [] + if from_date is not None or to_date is not None: + from_date, to_date = _date_range(from_date, to_date) + date_clauses = [DailyStat.date >= from_date, DailyStat.date <= to_date] result = await db.execute( select(DailyStat, Project) .join(Project, DailyStat.project_id == Project.id) .where( DailyStat.user_id == user.id, - DailyStat.date >= from_date, - DailyStat.date <= to_date, + *date_clauses, ) ) rows = result.all()