summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-06-07 17:08:09 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-06-07 17:08:09 +0700
commitc88d98f06a6301bad6dd6d2e58b4908d8562638c (patch)
tree282633b855acf235fe1d0d78b67d8cd46e032c03 /src/api
parent6ac1792ee37e5a5a9438f61e708966c944b61914 (diff)
<iman> add promotion program
Diffstat (limited to 'src/api')
-rw-r--r--src/api/promoApi.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/api/promoApi.js b/src/api/promoApi.js
new file mode 100644
index 00000000..a4acc768
--- /dev/null
+++ b/src/api/promoApi.js
@@ -0,0 +1,12 @@
+// src/api/promoApi.js
+import odooApi from '@/core/api/odooApi';
+
+export const fetchPromoItems = async (type) => {
+ try {
+ const response = await odooApi('GET', `/api/v1/program-line?type=${type}&limit=3`);
+ return response.map((item) => ({ value: item.id, label: item.name, product: item.products ,price:item.price}));
+ } catch (error) {
+ console.error('Error fetching promo items:', error);
+ return [];
+ }
+};