Simplify GEO API - use new list endpoints and routes in nearestOffers
All checks were successful
Build Docker Image / build (push) Successful in 4m11s

- Replace GetNodesDocument with HubsListDocument in useCatalogHubs.ts
- Replace GetSupplierProfilesDocument with SuppliersListDocument in useCatalogSuppliers.ts
- Replace manual grouping with ProductsListDocument in useCatalogProducts.ts
- Update nearestOffers to pass hubUuid for server-side route calculation
- Remove RouteToCoordinate calls - routes now included in nearestOffers response
- Delete 15 obsolete GraphQL files
- Add 3 new list endpoints: HubsList, SuppliersList, ProductsList
- Fix TypeScript errors in CalcResultContent, LocationsContent, hubs page, location store
This commit is contained in:
Ruslan Bakiev
2026-01-26 14:08:21 +07:00
parent 6d916d65a0
commit 65b07271d9
28 changed files with 190 additions and 504 deletions

View File

@@ -69,7 +69,7 @@
</template>
<script setup lang="ts">
import { GetNodesDocument } from '~/composables/graphql/public/geo-generated'
import { HubsListDocument } from '~/composables/graphql/public/geo-generated'
const { t } = useI18n()
const searchStore = useSearchStore()
@@ -84,9 +84,9 @@ const calculateDistance = (lat: number, lng: number) => {
}
// Load logistics hubs
const { data: locationsDataRaw, pending, error, refresh } = await useServerQuery('locations', GetNodesDocument, {}, 'public', 'geo')
const { data: locationsDataRaw, pending, error, refresh } = await useServerQuery('locations', HubsListDocument, { limit: 100 }, 'public', 'geo')
const locationsData = computed(() => {
return (locationsDataRaw.value?.nodes || []).map((location: any) => ({
return (locationsDataRaw.value?.hubsList || []).map((location: any) => ({
...location,
distance: location?.latitude && location?.longitude
? calculateDistance(location.latitude, location.longitude)