summaryrefslogtreecommitdiff
path: root/src/api/promoApi.js
blob: a4acc76889659ec1cfd192997082609bf2d9139d (plain)
1
2
3
4
5
6
7
8
9
10
11
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 [];
  }
};