Redirect search to catalog offers flow instead of /request
All checks were successful
Build Docker Image / build (push) Successful in 4m2s
All checks were successful
Build Docker Image / build (push) Successful in 4m2s
- GlobalSearchBar now redirects to /catalog/offers/[productId]/[hubId] - GoodsContent redirects to offers flow - select-location pages redirect to offers flow - Added quantity tag to offers page - Added KYC profile loading and offer detail navigation on offers page
This commit is contained in:
@@ -46,16 +46,16 @@ const selectProduct = (product: any) => {
|
||||
searchStore.setProduct(product.name)
|
||||
searchStore.setProductUuid(product.uuid)
|
||||
const locationUuid = searchStore.searchForm.locationUuid
|
||||
const quantity = searchStore.searchForm.quantity
|
||||
|
||||
const query: Record<string, string> = {}
|
||||
if (quantity) query.quantity = String(quantity)
|
||||
|
||||
if (locationUuid) {
|
||||
// Both product and hub selected -> show offers
|
||||
navigateTo({
|
||||
path: '/request',
|
||||
query: {
|
||||
productUuid: product.uuid,
|
||||
product: product.name,
|
||||
locationUuid,
|
||||
location: searchStore.searchForm.location,
|
||||
quantity: searchStore.searchForm.quantity || undefined
|
||||
}
|
||||
path: `/catalog/offers/${product.uuid}/${locationUuid}`,
|
||||
query
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -99,30 +99,33 @@ const canSearch = computed(() => {
|
||||
return !!productUuid.value
|
||||
})
|
||||
|
||||
// Search handler - navigate to /request
|
||||
// Search handler - navigate to catalog offers flow
|
||||
const handleSearch = () => {
|
||||
if (!canSearch.value) return
|
||||
|
||||
// Sync quantity to store
|
||||
syncQuantityToStore()
|
||||
|
||||
const query: Record<string, string | undefined> = {
|
||||
productUuid: productUuid.value || undefined,
|
||||
product: productDisplay.value || undefined,
|
||||
quantity: quantity.value ? String(quantity.value) : undefined,
|
||||
locationUuid: locationUuid.value || undefined,
|
||||
location: locationDisplay.value || undefined
|
||||
// Build query params
|
||||
const query: Record<string, string> = {}
|
||||
if (quantity.value) {
|
||||
query.quantity = String(quantity.value)
|
||||
}
|
||||
|
||||
// Remove undefined/empty values
|
||||
Object.keys(query).forEach(key => {
|
||||
if (!query[key]) delete query[key]
|
||||
})
|
||||
|
||||
router.push({
|
||||
path: localePath('/request'),
|
||||
query: query as Record<string, string>
|
||||
})
|
||||
// Navigate to offers flow
|
||||
if (productUuid.value && locationUuid.value) {
|
||||
// Both product and hub selected -> show offers
|
||||
router.push({
|
||||
path: localePath(`/catalog/offers/${productUuid.value}/${locationUuid.value}`),
|
||||
query
|
||||
})
|
||||
} else if (productUuid.value) {
|
||||
// Only product selected -> select hub
|
||||
router.push({
|
||||
path: localePath(`/catalog/offers/${productUuid.value}`),
|
||||
query
|
||||
})
|
||||
}
|
||||
|
||||
emit('search', {
|
||||
productUuid: productUuid.value,
|
||||
|
||||
Reference in New Issue
Block a user