diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-05-31 21:39:53 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-05-31 21:39:53 +0700 |
| commit | 77f976d3bd09d9e00d4d55bbd40579b439405d96 (patch) | |
| tree | a8959bba3d8a51570c439789f92653409a0065ae /src/pages/api/shop/search.js | |
| parent | ca05a70e98e9066882de6394ffbd89db7af2cb9d (diff) | |
| parent | 2a1dea70b8f0062fe8eebeb7139a7b77a24e220b (diff) | |
Merge branch 'new-release' of https://bitbucket.org/altafixco/next-indoteknik into biteship-merge
# Conflicts:
# src/lib/checkout/components/Checkout.jsx
# src/lib/transaction/components/Transaction.jsx
Diffstat (limited to 'src/pages/api/shop/search.js')
| -rw-r--r-- | src/pages/api/shop/search.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pages/api/shop/search.js b/src/pages/api/shop/search.js index 63ec7ca0..e14b0ca2 100644 --- a/src/pages/api/shop/search.js +++ b/src/pages/api/shop/search.js @@ -19,6 +19,7 @@ export default async function handler(req, res) { source = '', } = req.query; + let { stock = '' } = req.query; let paramOrderBy = ''; switch (orderBy) { @@ -88,6 +89,10 @@ export default async function handler(req, res) { 'price_tier1_v2_f:[1 TO *]', ]; + if (orderBy === 'stock') { + filterQueries.push('stock_total_f:{0 TO *}'); + } + if (fq && source != 'similar' && typeof fq != 'string') { // filterQueries.push(fq); fq.push(...filterQueries); |
