summaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/shop/lob/[slug].jsx63
1 files changed, 1 insertions, 62 deletions
diff --git a/src/pages/shop/lob/[slug].jsx b/src/pages/shop/lob/[slug].jsx
index cdaf3c91..d939c25c 100644
--- a/src/pages/shop/lob/[slug].jsx
+++ b/src/pages/shop/lob/[slug].jsx
@@ -25,60 +25,6 @@ export default function CategoryDetail() {
const lobId = getIdFromSlug(slug);
const q = router?.query.q || null;
- useEffect(() => {
- if(router.pathname.includes('lob')){
- const loadProduct = async () => {
- const lobData = await odooApi('GET', `/api/v1/lob_homepage/${lobId}/category_id`);
-
- if (lobData) {
- setDataLob(lobData);
- }
- };
- loadProduct();
-
- }
- }, [lobId]);
-
- useEffect(() => {
- if (router.pathname.includes('lob')){
-
- const fetchCategoryData = async () => {
- if (dataLob[0]?.categoryIds) {
-
- for (const cate of dataLob[0].categoryIds) {
-
- dataIdCategories.push(cate.childId)
- }
-
-
- setData(dataIdCategories.flat())
-
- // const newQuery = {
- // fq: `category_id_ids:(${mergedArray.join(' OR ')})`,
- // category : router.query.category? router.query.category : '',
- // page : router.query.page? router.query.page : 1,
- // brand : router.query.brand? router.query.brand : '',
- // priceFrom,
- // priceTo,
- // limit,
- // orderBy
- // };
-
- // setFinalQuery(newQuery);
-
- }
- };
- fetchCategoryData();
- }
- }, [dataCategoriesProduct, dataLob]);
- const query = {
- fq: `category_id_ids:(${data.join(' OR ')})`,
- page,
- };
- if (q) {
- query.q = q;
- }
-
return (
<BasicLayout>
<Seo
@@ -93,16 +39,9 @@ export default function CategoryDetail() {
/>
<Breadcrumb categoryId={getIdFromSlug(slug)} />
- <div className='grid grid-cols-3'>
- {dataLob[0]?.categoryIds && (
- <div>
- <image></image>
- </div>
- )}
- </div>
{!_.isEmpty(router.query) && (
- <ProductSearch query={query} categories={getIdFromSlug(slug)} prefixUrl={`/shop/lob/${slug}`} />
+ <ProductSearch query={router.query} categories={getIdFromSlug(slug)} prefixUrl={`/shop/lob/${slug}`} />
)}
</BasicLayout>
);