import api from "src/api";

export const getPackages = async () => {
  const { data } = await api.get("/class-package");
  return data.payload;
};

export const getPackage = async (id) => {
  const { data } = await api.get(`/class-package/${id}`);
  return data.payload;
};

export const createPackage = async (payload) => {
  const { data } = await api.post("/class-package", payload);
  return data.payload;
};

export const updatePackage = async (id, payload) => {
  const { data } = await api.put(`/class-package/${id}`, payload);
  return data.payload;
};

export const deletePackage = async (id) => {
  const { data } = await api.delete(`/class-package/${id}`);
  return data;
};
