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:
@@ -4,8 +4,8 @@ import { SuppliersListDocument, NearestSuppliersDocument } from '~/composables/g
|
||||
const PAGE_SIZE = 500
|
||||
|
||||
// Types from codegen
|
||||
type SupplierItem = NonNullable<NonNullable<SuppliersListQueryResult['suppliers_list']>[number]>
|
||||
type NearestSupplierItem = NonNullable<NonNullable<NearestSuppliersQueryResult['nearest_suppliers']>[number]>
|
||||
type SupplierItem = NonNullable<NonNullable<SuppliersListQueryResult['suppliersList']>[number]>
|
||||
type NearestSupplierItem = NonNullable<NonNullable<NearestSuppliersQueryResult['nearestSuppliers']>[number]>
|
||||
|
||||
// Shared state across list and map views
|
||||
const items = ref<Array<SupplierItem | NearestSupplierItem>>([])
|
||||
@@ -41,7 +41,7 @@ export function useCatalogSuppliers() {
|
||||
'public',
|
||||
'geo'
|
||||
)
|
||||
items.value = (data?.nearest_suppliers || []).filter((s): s is NearestSupplierItem => s !== null)
|
||||
items.value = (data?.nearestSuppliers || []).filter((s): s is NearestSupplierItem => s !== null)
|
||||
total.value = items.value.length
|
||||
isInitialized.value = true
|
||||
return
|
||||
@@ -63,7 +63,7 @@ export function useCatalogSuppliers() {
|
||||
'public',
|
||||
'geo'
|
||||
)
|
||||
const next = (data?.suppliers_list || []).filter((s): s is SupplierItem => s !== null)
|
||||
const next = (data?.suppliersList || []).filter((s): s is SupplierItem => s !== null)
|
||||
|
||||
items.value = replace ? next : items.value.concat(next)
|
||||
// suppliersList doesn't return total count, estimate from fetched items
|
||||
|
||||
Reference in New Issue
Block a user