From 4310c68248520d265879fbc0a2fc094f7f3e3b52 Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Fri, 20 Oct 2023 15:06:08 +0700 Subject: feedback testing - filter by brand (ada brand lain yang ikut) --- src/lib/product/components/ProductSearch.jsx | 35 +++++++++++++++------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'src/lib') diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx index 630e3a74..d094a25b 100644 --- a/src/lib/product/components/ProductSearch.jsx +++ b/src/lib/product/components/ProductSearch.jsx @@ -28,7 +28,7 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null, brand = null }) if (defaultBrand) query.brand = defaultBrand.toLowerCase() const { productSearch } = useProductSearch({ query: { ...query, q, limit, orderBy }, - operation: router?.pathname?.includes('brands') ? 'OR' : 'AND' + operation: 'OR' }) const [products, setProducts] = useState(null) const [spellings, setSpellings] = useState(null) @@ -295,21 +295,24 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null, brand = null })
-
-
Produk dari brand:
- {brand?.data?.logo && ( - {brand?.data?.name} - )} - {!brand?.data?.logo && ( -
- {brand?.data?.name} -
- )} -
+ {brand && ( +
+
Produk dari brand:
+ {brand?.data?.logo && ( + {brand?.data?.name} + )} + {!brand?.data?.logo && ( +
+ {brand?.data?.name} +
+ )} +
+ )} +