Add cascading filters for Explore mode
All checks were successful
Build Docker Image / build (push) Successful in 3m34s
All checks were successful
Build Docker Image / build (push) Successful in 3m34s
When a product is selected, hubs and suppliers are filtered to show only those that are relevant to that product.
This commit is contained in:
@@ -119,8 +119,8 @@ const {
|
||||
setHubFilter,
|
||||
clearFilters: clearProductFilters
|
||||
} = useCatalogProducts()
|
||||
const { items: hubs, isLoading: hubsLoading, isLoadingMore: hubsLoadingMore, canLoadMore: hubsCanLoadMore, loadMore: loadMoreHubs, init: initHubs } = useCatalogHubs()
|
||||
const { items: suppliers, isLoading: suppliersLoading, isLoadingMore: suppliersLoadingMore, canLoadMore: suppliersCanLoadMore, loadMore: loadMoreSuppliers, init: initSuppliers } = useCatalogSuppliers()
|
||||
const { items: hubs, isLoading: hubsLoading, isLoadingMore: hubsLoadingMore, canLoadMore: hubsCanLoadMore, loadMore: loadMoreHubs, init: initHubs, setProductFilter: setHubProductFilter } = useCatalogHubs()
|
||||
const { items: suppliers, isLoading: suppliersLoading, isLoadingMore: suppliersLoadingMore, canLoadMore: suppliersCanLoadMore, loadMore: loadMoreSuppliers, init: initSuppliers, setProductFilter: setSupplierProductFilter } = useCatalogSuppliers()
|
||||
|
||||
// Filtered items by map bounds
|
||||
const filteredProducts = computed(() => {
|
||||
@@ -196,6 +196,12 @@ watch([supplierId, hubId], ([newSupplierId, newHubId]) => {
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
// Apply product filter to hubs and suppliers (cascading filter)
|
||||
watch(productId, (newProductId) => {
|
||||
setHubProductFilter(newProductId || null)
|
||||
setSupplierProductFilter(newProductId || null)
|
||||
}, { immediate: true })
|
||||
|
||||
// Offers data for quote results
|
||||
const offers = ref<any[]>([])
|
||||
const offersLoading = ref(false)
|
||||
|
||||
Reference in New Issue
Block a user