Refactor shared data source selection for dashboard and map

This commit is contained in:
2026-04-21 17:56:59 +02:00
parent e244a85291
commit 86a7336ac0
5 changed files with 33 additions and 4 deletions

View File

@@ -331,7 +331,11 @@ Rewrite the four hooks listed above as thin wrappers around `useListData`.
---
### TASK-017 — Move `source` derivation out of page components
### TASK-017 — Move `source` derivation out of page components (done)
**Where fixed:** `frontend/src/utils/queryUtils.ts`, `frontend/src/pages/DashboardPage.tsx`, `frontend/src/pages/MapPage.tsx`
**Summary:** Added `getDataSource` to `frontend/src/utils/queryUtils.ts` and replaced inline `timeRange === "24h"` ternaries with the shared function in both dashboard and map pages.
**Where found:** `frontend/src/pages/DashboardPage.tsx` and `frontend/src/pages/MapPage.tsx` both contain the identical line:
```ts