Refactor shared data source selection for dashboard and map
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user