import api from "src/api";

export const getHolidays = async () => {
  const { data } = await api.get("/holiday");
  return data.payload;
};

export const createHoliday = async (holiday) => {
  const { data } = await api.post("/holiday", holiday);
  return data.payload;
};

export const updateHoliday = async (holiday, id) => {
  const { data } = await api.put(`/holiday/${id}`, holiday);
  return data.payload;
};

export const deleteHoliday = async (id) => {
  const { data } = await api.delete(`/holiday/${id}`);
  return data.payload;
};
