diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-03 10:38:52 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-03 10:38:52 +0700 |
| commit | b4abdb00ef83aa824e8a05d5b75df48adb7b9629 (patch) | |
| tree | 86ce2454793fe31b54a87f151433cbf86dbed134 /src/lib/product | |
| parent | 31816dc3a6cb62e1480524c8f0065a7835fefdcd (diff) | |
semi dynamic page
Diffstat (limited to 'src/lib/product')
| -rw-r--r-- | src/lib/product/api/productSearchApi.js | 2 | ||||
| -rw-r--r-- | src/lib/product/components/ProductSearch.jsx | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/product/api/productSearchApi.js b/src/lib/product/api/productSearchApi.js index 8ff8e57d..1626b7b7 100644 --- a/src/lib/product/api/productSearchApi.js +++ b/src/lib/product/api/productSearchApi.js @@ -1,7 +1,7 @@ import _ from 'lodash-contrib' import axios from 'axios' -const productSearchApi = async ({ query, operation = 'OR' }) => { +const productSearchApi = async ({ query, operation = 'AND' }) => { const dataProductSearch = await axios( `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/search?${query}&operation=${operation}` ) diff --git a/src/lib/product/components/ProductSearch.jsx b/src/lib/product/components/ProductSearch.jsx index 76dba005..2233925d 100644 --- a/src/lib/product/components/ProductSearch.jsx +++ b/src/lib/product/components/ProductSearch.jsx @@ -137,7 +137,9 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => { </> )} </> - ) : SpellingComponent} + ) : ( + SpellingComponent + )} </div> {productFound > 0 && ( @@ -205,7 +207,9 @@ const ProductSearch = ({ query, prefixUrl, defaultBrand = null }) => { </> )} </> - ) : SpellingComponent} + ) : ( + SpellingComponent + )} </div> <div className='justify-end flex '> <div className='ml-3'> |
