import ApiService from "@/services/ApiService";

const base = "clientes";

export const getClientes = async (params = {}) => {
  const res = await ApiService.get(base, { params });
  return res.data;
};

export const getCliente = async (id) => {
  const res = await ApiService.get(`${base}/${id}`);
  return res.data;
};

export const getClienteMostrador = async () => {
  const res = await ApiService.get(`${base}/mostrador`);
  return res.data;
};

export const createCliente = async (payload) => {
  const res = await ApiService.post(base, payload);
  return res.data;
};

export const updateCliente = async (id, payload) => {
  const res = await ApiService.put(`${base}/${id}`, payload);
  return res.data;
};

export const deleteCliente = async (id) => {
  const res = await ApiService.delete(`${base}/${id}`);
  return res.data;
};
