Simplify GEO API - use new list endpoints and routes in nearestOffers
All checks were successful
Build Docker Image / build (push) Successful in 4m11s
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:
@@ -1,7 +1,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref, computed } from 'vue'
|
||||
import { useGraphQL } from '~/composables/useGraphQL'
|
||||
import { GetNodesDocument } from '~/composables/graphql/public/geo-generated'
|
||||
import { GetNodeDocument } from '~/composables/graphql/public/geo-generated'
|
||||
|
||||
interface SelectedLocation {
|
||||
type: 'address' | 'hub'
|
||||
@@ -33,9 +33,9 @@ export const useLocationStore = defineStore('location', () => {
|
||||
const { type, uuid } = team.selectedLocation
|
||||
|
||||
if (type === 'hub') {
|
||||
const { data: nodesData, error: nodesError } = await useServerQuery('location-nodes', GetNodesDocument, {}, 'public', 'geo')
|
||||
if (nodesError.value) throw nodesError.value
|
||||
const hub = nodesData.value?.nodes?.find((n) => n?.uuid === uuid)
|
||||
const { data: nodeData, error: nodeError } = await useServerQuery('location-node', GetNodeDocument, { uuid }, 'public', 'geo')
|
||||
if (nodeError.value) throw nodeError.value
|
||||
const hub = nodeData.value?.node
|
||||
if (hub && hub.uuid && hub.name && hub.latitude != null && hub.longitude != null) {
|
||||
selectedLocation.value = {
|
||||
type: 'hub',
|
||||
|
||||
Reference in New Issue
Block a user