import ApiService from "@/services/ApiService";

const base = "productos";

export const getProductos = async () => {
  const response = await ApiService.get(base);
  return response.data;
};

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

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

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

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