diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-08-19 14:53:22 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-08-19 14:53:22 +0700 |
| commit | 3c6c2a888e3ab27b4d5eead34104fd142f82b1ff (patch) | |
| tree | 54783e36827a1ea14d1887885f3c4c54c28b80e9 /src/lib | |
| parent | 76e798e1266c1d888a97c6f866ae782dd6f0045f (diff) | |
<iman> update order by non flash display
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/product/components/ProductSearch.jsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx index b799d533..f8b44529 100644 --- a/src/lib/product/components/ProductSearch.jsx +++ b/src/lib/product/components/ProductSearch.jsx @@ -53,6 +53,8 @@ const ProductSearch = ({ if (defaultBrand) query.brand = defaultBrand.toLowerCase(); const dataIdCategories = [] + console.log('data',router) + useEffect(() => { const checkIfPenawaran = async () => { if (router.asPath.includes('penawaran')) { @@ -64,11 +66,13 @@ const ProductSearch = ({ ], orderBy: 'flashsale-discount-desc' }; + console.log('setOrder') setOrderBy('flashsale-discount-desc') + console.log('orderBy',orderBy) } }; checkIfPenawaran(); - }, [router]); + }, [router.query, prefixUrl, q, finalQuery, queryFinal]); useEffect(() => { if(prefixUrl.includes('category')){ @@ -156,9 +160,10 @@ const ProductSearch = ({ if (prefixUrl.includes('category') || prefixUrl.includes('lob')) { setQueryFinal({ ...finalQuery, q, limit, orderBy }); } else { + console.log("data query",orderBy) setQueryFinal({ ...query, q, limit, orderBy }); } - }, [prefixUrl,dataCategoriesProduct, query, finalQuery]); + }, [prefixUrl,dataCategoriesProduct, query, finalQuery, orderBy]); const { productSearch } = useProductSearch({ |
