import http from "../http-common";

const getAll = (template_date) => {
  const params = {};
  if (template_date) {
    params.template_date = template_date;
  }
  return http.get("/daily-routes-templates", {params});
};

const createNewDailyRoutesTemplate = (data) => {
  return http.post('/daily-routes-templates', data);
};

const updateDailyRoutesTemplate = (id, data) => {
  return http.put(`/daily-routes-templates/${id}`, data);
};

const getDailyRoutesTemplate = (id) => {
  return http.get(`/daily-routes-templates/${id}`);
};

const deleteDailyRoutesTemplate = (id) => {
  return http.delete(`/daily-routes-templates/${id}`);
};

export const DailyRoutesTemplateService = {
  getAll,
  createNewDailyRoutesTemplate,
  updateDailyRoutesTemplate,
  getDailyRoutesTemplate,
  deleteDailyRoutesTemplate
};

