Optimize catalog loading: backend bounds filtering + early returns
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:
Ruslan Bakiev
2026-01-24 12:19:00 +07:00
parent 8c753edb28
commit 9b99d8981c
6 changed files with 97 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
query GetNodes($limit: Int, $offset: Int, $transportType: String, $country: String) {
nodes(limit: $limit, offset: $offset, transportType: $transportType, country: $country) {
query GetNodes($limit: Int, $offset: Int, $transportType: String, $country: String, $west: Float, $south: Float, $east: Float, $north: Float) {
nodes(limit: $limit, offset: $offset, transportType: $transportType, country: $country, west: $west, south: $south, east: $east, north: $north) {
uuid
name
latitude
@@ -9,5 +9,5 @@ query GetNodes($limit: Int, $offset: Int, $transportType: String, $country: Stri
syncedAt
transportTypes
}
nodesCount(transportType: $transportType, country: $country)
nodesCount(transportType: $transportType, country: $country, west: $west, south: $south, east: $east, north: $north)
}