fix: migrate geo GraphQL queries and frontend to camelCase
All checks were successful
Build Docker Image / build (push) Successful in 5m0s
All checks were successful
Build Docker Image / build (push) Successful in 5m0s
Geo backend was migrated to camelCase but frontend .graphql files and component code still used snake_case, causing 400 errors on all geo API calls.
This commit is contained in:
@@ -39,8 +39,8 @@
|
||||
<Stack v-if="autoEdges.length > 0" gap="2">
|
||||
<NuxtLink
|
||||
v-for="(edge, index) in autoEdges"
|
||||
:key="edge.to_uuid ?? index"
|
||||
:to="localePath(`/catalog/hubs/${edge.to_uuid}`)"
|
||||
:key="edge.toUuid ?? index"
|
||||
:to="localePath(`/catalog/hubs/${edge.toUuid}`)"
|
||||
class="flex flex-col gap-2 p-3 rounded-lg border border-base-300 hover:bg-base-200 transition-colors"
|
||||
>
|
||||
<div class="flex items-center justify-between">
|
||||
@@ -49,11 +49,11 @@
|
||||
<Icon name="lucide:map-pin" size="16" class="text-primary" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="font-medium">{{ edge.to_name }}</div>
|
||||
<div class="font-medium">{{ edge.toName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<div class="font-semibold text-primary">{{ edge.distance_km }} km</div>
|
||||
<div class="font-semibold text-primary">{{ edge.distanceKm }} km</div>
|
||||
</div>
|
||||
</div>
|
||||
</NuxtLink>
|
||||
@@ -71,8 +71,8 @@
|
||||
<Stack v-if="railEdges.length > 0" gap="2">
|
||||
<NuxtLink
|
||||
v-for="(edge, index) in railEdges"
|
||||
:key="edge.to_uuid ?? index"
|
||||
:to="localePath(`/catalog/hubs/${edge.to_uuid}`)"
|
||||
:key="edge.toUuid ?? index"
|
||||
:to="localePath(`/catalog/hubs/${edge.toUuid}`)"
|
||||
class="flex flex-col gap-2 p-3 rounded-lg border border-base-300 hover:bg-base-200 transition-colors"
|
||||
>
|
||||
<div class="flex items-center justify-between">
|
||||
@@ -81,11 +81,11 @@
|
||||
<Icon name="lucide:map-pin" size="16" class="text-emerald-500" />
|
||||
</div>
|
||||
<div>
|
||||
<div class="font-medium">{{ edge.to_name }}</div>
|
||||
<div class="font-medium">{{ edge.toName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<div class="font-semibold text-emerald-600">{{ edge.distance_km }} km</div>
|
||||
<div class="font-semibold text-emerald-600">{{ edge.distanceKm }} km</div>
|
||||
</div>
|
||||
</div>
|
||||
</NuxtLink>
|
||||
@@ -147,8 +147,8 @@ const mapCenter = computed<[number, number]>(() => {
|
||||
|
||||
const allEdges = [...props.autoEdges, ...props.railEdges]
|
||||
allEdges.forEach((edge) => {
|
||||
if (edge.to_latitude && edge.to_longitude) {
|
||||
points.push([edge.to_longitude, edge.to_latitude])
|
||||
if (edge.toLatitude && edge.toLongitude) {
|
||||
points.push([edge.toLongitude, edge.toLatitude])
|
||||
}
|
||||
})
|
||||
|
||||
@@ -161,7 +161,7 @@ const mapCenter = computed<[number, number]>(() => {
|
||||
})
|
||||
|
||||
const mapZoom = computed(() => {
|
||||
const distances = [...props.autoEdges, ...props.railEdges].map(e => e.distance_km || 0)
|
||||
const distances = [...props.autoEdges, ...props.railEdges].map(e => e.distanceKm || 0)
|
||||
if (distances.length === 0) return 5
|
||||
|
||||
const maxDistance = Math.max(...distances)
|
||||
@@ -193,18 +193,18 @@ const buildRouteFeatureCollection = (routes: RouteGeometry[], transportType: 'au
|
||||
const buildNeighborsFeatureCollection = (edges: Edge[], transportType: 'auto' | 'rail') => ({
|
||||
type: 'FeatureCollection' as const,
|
||||
features: edges
|
||||
.filter(e => e.to_latitude && e.to_longitude)
|
||||
.filter(e => e.toLatitude && e.toLongitude)
|
||||
.map(edge => ({
|
||||
type: 'Feature' as const,
|
||||
properties: {
|
||||
uuid: edge.to_uuid,
|
||||
name: edge.to_name,
|
||||
distanceKm: edge.distance_km,
|
||||
uuid: edge.toUuid,
|
||||
name: edge.toName,
|
||||
distanceKm: edge.distanceKm,
|
||||
transportType
|
||||
},
|
||||
geometry: {
|
||||
type: 'Point' as const,
|
||||
coordinates: [edge.to_longitude!, edge.to_latitude!]
|
||||
coordinates: [edge.toLongitude!, edge.toLatitude!]
|
||||
}
|
||||
}))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user