import { api } from "../utils/axiosClient";

export const TasksRepository = {
  getTaskList: (id, fromdate = null, todate = null) => {
    let url = `api/task/list?projectId=${id}`;

    if (fromdate) {
      url += `&dateFrom=${fromdate}`;
    }

    if (todate) {
      url += `&dateTo=${todate}`;
    }

    return api.get(url);
  },
  reportTask: (data) => api.post("api/task/report", data),
  taskComments: (data) => api.post("api/task/comment", data),
};
