summaryrefslogtreecommitdiff
path: root/src/pages
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-05-27 10:32:45 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-05-27 10:32:45 +0700
commit62d2edfa5ae62cd8faa2d0322ddfd5dfa6ad2d2e (patch)
treed6cceab24bd7f7c4dbfc4c0ff3ef3c932e0d9b14 /src/pages
parent6499f025995f13fcf32b2b5f79c8ee14585668fc (diff)
parentfd867a90e22fb2fc2fb16237165796ebe0cabab0 (diff)
<hafid> merge repeat order & new-release
Diffstat (limited to 'src/pages')
-rw-r--r--src/pages/api/flashsale-header.js2
-rw-r--r--src/pages/api/shop/search.js5
-rw-r--r--src/pages/api/webhook/biteship.js13
-rw-r--r--src/pages/daftar-merchant.jsx2
4 files changed, 20 insertions, 2 deletions
diff --git a/src/pages/api/flashsale-header.js b/src/pages/api/flashsale-header.js
index 578801ae..916a9cd2 100644
--- a/src/pages/api/flashsale-header.js
+++ b/src/pages/api/flashsale-header.js
@@ -35,7 +35,7 @@ export default async function handler(req, res) {
}
return res.status(200).json({ data });
} else {
- const flashSale = await odooApi('GET', `/api/v1/flashsale/header`);
+ const flashSale = await odooApi('GET', `/api/v1/flashsale/header?is_show_program=true`);
if (flashSale.length === 0) {
return res.status(200).json({ data: [] });
} else {
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);
diff --git a/src/pages/api/webhook/biteship.js b/src/pages/api/webhook/biteship.js
new file mode 100644
index 00000000..f1100d2d
--- /dev/null
+++ b/src/pages/api/webhook/biteship.js
@@ -0,0 +1,13 @@
+import odooApi from '@/core/api/odooApi';
+
+
+export default async function handler(req, res) {
+ const body = req.body
+
+ if(req.body){
+ let result = odooApi('POST', '/api/v1/webhook/biteship', body)
+ }
+
+ res.status(200).send("ok");
+
+} \ No newline at end of file
diff --git a/src/pages/daftar-merchant.jsx b/src/pages/daftar-merchant.jsx
index e1fa9bcb..945a0060 100644
--- a/src/pages/daftar-merchant.jsx
+++ b/src/pages/daftar-merchant.jsx
@@ -12,4 +12,4 @@ export default function DaftarMerchant() {
</BasicLayout>
</>
)
-}
+} \ No newline at end of file