From 969ca83a9adce96b3b58973654b29d3c2dd47a88 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 5 Sep 2024 17:49:57 +0700
Subject: <iman> update mapping solr

---
 src/lib/home/components/CategoryDynamic.jsx | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

(limited to 'src/lib/home/components/CategoryDynamic.jsx')

diff --git a/src/lib/home/components/CategoryDynamic.jsx b/src/lib/home/components/CategoryDynamic.jsx
index c257e9f9..11a15d6d 100644
--- a/src/lib/home/components/CategoryDynamic.jsx
+++ b/src/lib/home/components/CategoryDynamic.jsx
@@ -1,5 +1,6 @@
-import React, { useEffect, useState } from 'react';
+import React, { useEffect, useState, useCallback } from 'react';
 import useCategoryManagement from '../hooks/useCategoryManagement';
+import {fetchPopulerProductSolr} from '../api/categoryManagementApi'
 import NextImage from 'next/image';
 import Link from "next/link";
 import { createSlug } from '@/core/utils/slug';
@@ -12,6 +13,28 @@ import 'swiper/css/pagination';
 import { Navigation, Pagination, Autoplay } from 'swiper';
 
 const CategoryDynamic = () => {
+
+  const [manufactures, setManufactures] = useState([])
+  const loadBrand = useCallback(async () => {
+    // setIsLoading(true)
+    //Get brand from odoo
+    /*const result = await odooApi(
+      'GET',
+      `/api/v1/manufacture?limit=0&offset=${manufactures.length}&name=${name}`
+    )*/
+
+    // Change get brands from solr
+    const items = await fetchPopulerProductSolr();
+
+    console.log("items",items)
+    
+    // setIsLoading(false)
+    // setManufactures((manufactures) => [...result.data])
+  }, [])
+
+  useEffect(() => {
+    loadBrand()
+  }, [loadBrand])
   const { categoryManagement } = useCategoryManagement();
   // const [categoryData, setCategoryData] = useState({});
   // const [subCategoryData, setSubCategoryData] = useState({});
-- 
cgit v1.2.3

