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);
  },

  getTaskById:(id)=>api.get(`/api/task/get/${id}`),
  reportTask: (data) => api.post("api/task/report", data),
  taskComments: ( data ) => api.post( "api/task/comment", data ),
  auditTask: ( data ) => api.post( '/api/task/approve', data ),
  
  assignTask:(data) =>api.post('/api/task/assign',data)

};
