diff options
| author | Rafi Zadanly <rafizadanly@gmail.com> | 2022-12-02 17:32:29 +0700 |
|---|---|---|
| committer | Rafi Zadanly <rafizadanly@gmail.com> | 2022-12-02 17:32:29 +0700 |
| commit | 21a22d686e71d8eb470d158f93ba80e43b7b221f (patch) | |
| tree | c3e73b060331088336a6fd764493a09b9a9e1f46 /src/pages/shop/search.js | |
| parent | 0a0c497204acbac562700d80f38e74aa9ffcd94e (diff) | |
input range filter, sort by ready stock
Diffstat (limited to 'src/pages/shop/search.js')
| -rw-r--r-- | src/pages/shop/search.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pages/shop/search.js b/src/pages/shop/search.js index 2ae3cca4..e365fcf5 100644 --- a/src/pages/shop/search.js +++ b/src/pages/shop/search.js @@ -13,8 +13,8 @@ export async function getServerSideProps(context) { page = 1, brand = '', category = '', - price_from = '0', - price_to = '0', + price_from = '', + price_to = '', order_by = '', } = context.query; @@ -53,8 +53,8 @@ export default function ShopSearch({ let route = `/shop/search?q=${q}`; if (brand) route += `&brand=${brand}`; if (category) route += `&category=${category}`; - if (price_from > 0) route += `&price_from=${price_from}`; - if (price_to > 0) route += `&price_to=${price_to}`; + if (price_from) route += `&price_from=${price_from}`; + if (price_to) route += `&price_to=${price_to}`; if (order_by) route += `&order_by=${order_by}`; return route; } |
