Fix geo GraphQL schema mismatch: camelCase → snake_case
All checks were successful
Build Docker Image / build (push) Successful in 5m46s
All checks were successful
Build Docker Image / build (push) Successful in 5m46s
All geo .graphql operations and consuming code updated to match server schema which uses snake_case field/argument names. Removed non-existent QuoteCalculations query, using NearestOffers instead.
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
</Text>
|
||||
</div>
|
||||
<!-- Transport icons bottom -->
|
||||
<div v-if="hub.transportTypes?.length" class="flex items-center gap-1 pt-1">
|
||||
<div v-if="hub.transport_types?.length" class="flex items-center gap-1 pt-1">
|
||||
<Icon v-if="hasTransport('auto')" name="lucide:truck" size="14" class="text-base-content/50" />
|
||||
<Icon v-if="hasTransport('rail')" name="lucide:train-front" size="14" class="text-base-content/50" />
|
||||
<Icon v-if="hasTransport('sea')" name="lucide:ship" size="14" class="text-base-content/50" />
|
||||
@@ -58,12 +58,12 @@ interface Hub {
|
||||
uuid?: string | null
|
||||
name?: string | null
|
||||
country?: string | null
|
||||
countryCode?: string | null
|
||||
country_code?: string | null
|
||||
latitude?: number | null
|
||||
longitude?: number | null
|
||||
distance?: string
|
||||
distanceKm?: number | null
|
||||
transportTypes?: (string | null)[] | null
|
||||
distance_km?: number | null
|
||||
transport_types?: (string | null)[] | null
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -91,16 +91,16 @@ const isoToEmoji = (code: string): string => {
|
||||
}
|
||||
|
||||
const countryFlag = computed(() => {
|
||||
if (props.hub.countryCode) {
|
||||
return isoToEmoji(props.hub.countryCode)
|
||||
if (props.hub.country_code) {
|
||||
return isoToEmoji(props.hub.country_code)
|
||||
}
|
||||
return '🌍'
|
||||
})
|
||||
|
||||
const hasTransport = (type: string) => props.hub.transportTypes?.some(t => t === type)
|
||||
const hasTransport = (type: string) => props.hub.transport_types?.some(t => t === type)
|
||||
const distanceLabel = computed(() => {
|
||||
if (props.hub.distance) return props.hub.distance
|
||||
if (props.hub.distanceKm != null) return `${Math.round(props.hub.distanceKm)} km`
|
||||
if (props.hub.distance_km != null) return `${Math.round(props.hub.distance_km)} km`
|
||||
return ''
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user