holiday.js 631 B

123456789101112131415161718192021
  1. import api from "src/api";
  2. export const getHolidays = async () => {
  3. const { data } = await api.get("/franchisee/dashboard/holidays");
  4. return data.payload;
  5. };
  6. export const createHoliday = async (holiday) => {
  7. const { data } = await api.post("/franchisee/dashboard/holidays", holiday);
  8. return data.payload;
  9. };
  10. export const updateHoliday = async (holiday, id) => {
  11. const { data } = await api.put(`/franchisee/dashboard/holidays/${id}`, holiday);
  12. return data.payload;
  13. };
  14. export const deleteHoliday = async (id) => {
  15. const { data } = await api.delete(`/franchisee/dashboard/holidays/${id}`);
  16. return data.payload;
  17. };