summaryrefslogtreecommitdiff
path: root/src/api/promoApi.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/promoApi.js')
-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 [];
+ }
+};