From c88d98f06a6301bad6dd6d2e58b4908d8562638c Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Fri, 7 Jun 2024 17:08:09 +0700 Subject: add promotion program --- src/api/promoApi.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/api/promoApi.js (limited to 'src/api') 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 []; + } +}; -- cgit v1.2.3