summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-07-30 15:08:00 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-07-30 15:08:00 +0700
commit09e2fd0ec1e2a1d8438ec1c630a08bc349400ecb (patch)
treef3b191e2b08cebf5e007620014415c8809828c77 /src
parent5296ce7dba6cf674b4942113a7716a89f05b64e0 (diff)
<iman> update error code
Diffstat (limited to 'src')
-rw-r--r--src/lib/product/components/ProductFilterDesktop.jsx10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/product/components/ProductFilterDesktop.jsx b/src/lib/product/components/ProductFilterDesktop.jsx
index 384f2daa..a8073036 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 }) => {
+
const router = useRouter()
const { query } = router
const [order, setOrder] = useState(query?.orderBy)
@@ -102,19 +103,14 @@ const ProductFilterDesktop = ({ brands, categories, prefixUrl, defaultBrand = nu
}
params = _.pickBy(params, _.identity)
params = toQuery(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}`)
- }
+ router.push(`${prefixUrl}/${slug}?${params}`)
} else {
router.push(`${prefixUrl}?${params}`)
}
-
}