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:
@@ -37,15 +37,15 @@
|
||||
>
|
||||
<OfferResultCard
|
||||
grouped
|
||||
:supplier-name="offer.supplier_name"
|
||||
:supplier-name="offer.supplierName"
|
||||
:location-name="offer.country || ''"
|
||||
:product-name="offer.product_name"
|
||||
:price-per-unit="offer.price_per_unit ? Number(offer.price_per_unit) : null"
|
||||
:product-name="offer.productName"
|
||||
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
|
||||
:quantity="offer.quantity"
|
||||
:currency="offer.currency"
|
||||
:unit="offer.unit"
|
||||
:stages="getOfferStages(offer)"
|
||||
:total-time-seconds="offer.routes?.[0]?.total_time_seconds ?? null"
|
||||
:total-time-seconds="offer.routes?.[0]?.totalTimeSeconds ?? null"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,15 +58,15 @@
|
||||
@click="emit('select-offer', offer)"
|
||||
>
|
||||
<OfferResultCard
|
||||
:supplier-name="offer.supplier_name"
|
||||
:supplier-name="offer.supplierName"
|
||||
:location-name="offer.country || ''"
|
||||
:product-name="offer.product_name"
|
||||
:price-per-unit="offer.price_per_unit ? Number(offer.price_per_unit) : null"
|
||||
:product-name="offer.productName"
|
||||
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
|
||||
:quantity="offer.quantity"
|
||||
:currency="offer.currency"
|
||||
:unit="offer.unit"
|
||||
:stages="getOfferStages(offer)"
|
||||
:total-time-seconds="offer.routes?.[0]?.total_time_seconds ?? null"
|
||||
:total-time-seconds="offer.routes?.[0]?.totalTimeSeconds ?? null"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,23 +78,23 @@
|
||||
<script setup lang="ts">
|
||||
interface Offer {
|
||||
uuid: string
|
||||
product_name?: string | null
|
||||
product_uuid?: string | null
|
||||
supplier_name?: string | null
|
||||
supplier_uuid?: string | null
|
||||
productName?: string | null
|
||||
productUuid?: string | null
|
||||
supplierName?: string | null
|
||||
supplierUuid?: string | null
|
||||
quantity?: number | string | null
|
||||
unit?: string | null
|
||||
price_per_unit?: number | string | null
|
||||
pricePerUnit?: number | string | null
|
||||
currency?: string | null
|
||||
country?: string | null
|
||||
country_code?: string | null
|
||||
countryCode?: string | null
|
||||
routes?: Array<{
|
||||
total_time_seconds?: number | null
|
||||
totalTimeSeconds?: number | null
|
||||
stages?: Array<{
|
||||
transport_type?: string | null
|
||||
distance_km?: number | null
|
||||
travel_time_seconds?: number | null
|
||||
from_name?: string | null
|
||||
transportType?: string | null
|
||||
distanceKm?: number | null
|
||||
travelTimeSeconds?: number | null
|
||||
fromName?: string | null
|
||||
} | null> | null
|
||||
} | null> | null
|
||||
}
|
||||
@@ -115,7 +115,7 @@ const props = defineProps<{
|
||||
}>()
|
||||
|
||||
const offersWithPrice = computed(() =>
|
||||
(props.offers || []).filter(o => o?.price_per_unit != null)
|
||||
(props.offers || []).filter(o => o?.pricePerUnit != null)
|
||||
)
|
||||
|
||||
const totalOffers = computed(() => {
|
||||
@@ -139,10 +139,10 @@ const getOfferStages = (offer: Offer) => {
|
||||
return route.stages
|
||||
.filter((stage): stage is NonNullable<typeof stage> => stage !== null)
|
||||
.map((stage) => ({
|
||||
transportType: stage.transport_type,
|
||||
distanceKm: stage.distance_km,
|
||||
travelTimeSeconds: stage.travel_time_seconds,
|
||||
fromName: stage.from_name
|
||||
transportType: stage.transportType,
|
||||
distanceKm: stage.distanceKm,
|
||||
travelTimeSeconds: stage.travelTimeSeconds,
|
||||
fromName: stage.fromName
|
||||
}))
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user