diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-07-30 15:06:02 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-07-30 15:06:02 +0700 |
| commit | 5296ce7dba6cf674b4942113a7716a89f05b64e0 (patch) | |
| tree | ec06352e2b4a29be2d874800a043bea848fe21cd /src | |
| parent | c92b47f81b4ea90f799810555395af7afcfa5a4d (diff) | |
<iman> update category management search product
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/product/components/ProductFilterDesktop.jsx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/product/components/ProductFilterDesktop.jsx b/src/lib/product/components/ProductFilterDesktop.jsx index e4a62abb..384f2daa 100644 --- a/src/lib/product/components/ProductFilterDesktop.jsx +++ b/src/lib/product/components/ProductFilterDesktop.jsx @@ -102,7 +102,19 @@ const ProductFilterDesktop = ({ brands, categories, prefixUrl, defaultBrand = nu } params = _.pickBy(params, _.identity) params = toQuery(params) - router.push(`${prefixUrl}?${params}`) + + const slug = Array.isArray(router.query.slug) ? router.query.slug[0] : router.query.slug; + + if (slug) { + if(prefixUrl.includes('category') || prefixUrl.includes('lob')){ + router.push(`${prefixUrl}?${params}`) + }else{ + router.push(`${prefixUrl}/${slug}?${params}`) + } + } else { + router.push(`${prefixUrl}?${params}`) + } + } |
