summaryrefslogtreecommitdiff
path: root/src/lib/product/components
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-06-13 09:34:24 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-06-13 09:34:24 +0700
commit0a87455727114468c216fbcd74266ea928eaec37 (patch)
tree7e285c407073f609667625d98432c5afff7fe104 /src/lib/product/components
parentce968fcd38e5c4bb69400862fe4da484934088d5 (diff)
<iman> update promotion-program
Diffstat (limited to 'src/lib/product/components')
-rw-r--r--src/lib/product/components/ProductFilterDesktop.jsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/product/components/ProductFilterDesktop.jsx b/src/lib/product/components/ProductFilterDesktop.jsx
index e4a62abb..b4afebc2 100644
--- a/src/lib/product/components/ProductFilterDesktop.jsx
+++ b/src/lib/product/components/ProductFilterDesktop.jsx
@@ -21,6 +21,7 @@ import Image from '@/core/components/elements/Image/Image'
import { formatCurrency } from '@/core/utils/formatValue'
const ProductFilterDesktop = ({ brands, categories, prefixUrl, defaultBrand = null }) => {
+ console.log("prefixUrl",prefixUrl)
const router = useRouter()
const { query } = router
const [order, setOrder] = useState(query?.orderBy)
@@ -102,7 +103,14 @@ 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) {
+ router.push(`${prefixUrl}/${slug}?${params}`)
+ } else {
+ router.push(`${prefixUrl}?${params}`)
+ }
}