Fix type safety in catalog composables + 3 InfoPanel bugs
All checks were successful
Build Docker Image / build (push) Successful in 3m42s
All checks were successful
Build Docker Image / build (push) Successful in 3m42s
- Add proper codegen types to all catalog composables: - useCatalogHubs: HubItem, NearestHubItem - useCatalogSuppliers: SupplierItem, NearestSupplierItem - useCatalogProducts: ProductItem - useCatalogOffers: OfferItem - useCatalogInfo: InfoEntity, ProductItem, HubItem, OfferItem - Fix InfoPanel bugs for offers: - Use locationLatitude/locationLongitude for offer coordinates - Enrich entity with supplierName after loading profile - Apply-to-filter now adds both product AND hub for offers - Filter null values from GraphQL array responses - Add type-safe coordinate helper (getEntityCoords) - Fix urlBounds type inference in useCatalogSearch
This commit is contained in:
@@ -85,12 +85,12 @@ export function useCatalogSearch() {
|
||||
const quantity = computed(() => route.query.qty as string | undefined)
|
||||
|
||||
// Map bounds from URL (format: west,south,east,north)
|
||||
const urlBounds = computed(() => {
|
||||
const urlBounds = computed((): { west: number; south: number; east: number; north: number } | null => {
|
||||
const b = route.query.bounds as string | undefined
|
||||
if (!b) return null
|
||||
const parts = b.split(',').map(Number)
|
||||
if (parts.length !== 4 || parts.some(isNaN)) return null
|
||||
return { west: parts[0], south: parts[1], east: parts[2], north: parts[3] }
|
||||
return { west: parts[0]!, south: parts[1]!, east: parts[2]!, north: parts[3]! }
|
||||
})
|
||||
|
||||
// Filter by bounds checkbox state from URL
|
||||
|
||||
Reference in New Issue
Block a user