Optimize catalog loading: backend bounds filtering + early returns
All checks were successful
Build Docker Image / build (push) Successful in 4m12s
All checks were successful
Build Docker Image / build (push) Successful in 4m12s
- Add bounds (west/south/east/north) parameters to GetNodes query - Add setBoundsFilter to useCatalogHubs, useCatalogSuppliers, useCatalogProducts - Replace client-side bounds filtering with backend query - Add early return to setProductFilter to avoid redundant fetches - Watch filterByBounds to trigger backend refetch when checkbox changes
This commit is contained in:
@@ -99,6 +99,13 @@ export function useCatalogProducts() {
|
||||
}
|
||||
}
|
||||
|
||||
// Products don't have coordinates directly (they're an aggregation of offers)
|
||||
// Bounds filtering would require a new backend query that filters by offer locations
|
||||
// For now, this is a no-op - products show all regardless of map bounds
|
||||
const setBoundsFilter = (_bounds: { west: number; south: number; east: number; north: number } | null) => {
|
||||
// No-op: products are not filterable by map bounds in current implementation
|
||||
}
|
||||
|
||||
return {
|
||||
items,
|
||||
isLoading,
|
||||
@@ -110,6 +117,7 @@ export function useCatalogProducts() {
|
||||
init,
|
||||
setSupplierFilter,
|
||||
setHubFilter,
|
||||
clearFilters
|
||||
clearFilters,
|
||||
setBoundsFilter
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user