From 834b057ecb8eb1af06160b01c623332a35b169fa Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Tue, 26 Sep 2023 10:11:13 +0700 Subject: brand solr dan sort by image --- src/lib/brand/components/Brands.jsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/lib/brand/components') diff --git a/src/lib/brand/components/Brands.jsx b/src/lib/brand/components/Brands.jsx index c94e47c2..f6cb4fbf 100644 --- a/src/lib/brand/components/Brands.jsx +++ b/src/lib/brand/components/Brands.jsx @@ -21,14 +21,10 @@ const Brands = () => { )*/ // Change get brands from solr - let result = null - if (name) { - result = await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands?params=${name}`) - } else { - result = await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands`) - } + const result = await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/brands?params=${name}`) + setIsLoading(false) - setManufactures((manufactures) => [...manufactures, ...result.data]) + setManufactures((manufactures) => [...result.data]) }, [startWith]) const toggleStartWith = (alphabet) => { -- cgit v1.2.3