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

const GlobalRepository = {
  getDashboardProgressionData: ({ days = '', FromDate = '', projectId = '' }) => {
    let params;
    if(projectId == null){
      params = new URLSearchParams({
        days: days.toString(),
        FromDate,
      });
    }else{
      params = new URLSearchParams({
        days: days.toString(),
        FromDate,
        projectId,
      });
    }

    return api.get(`/api/Dashboard/Progression?${params.toString()}`);
  },

  getDashboardAttendanceData: ( date,projectId ) => {  

  return api.get(`/api/Dashboard/project-attendance/${projectId}?date=${date}`);
},
  getDashboardProjectsCardData: () => {
    return api.get(`/api/Dashboard/projects`);
  },
  getDashboardTeamsCardData: () => {
    return api.get(`/api/Dashboard/teams`);
  },
  getDashboardTasksCardData: () => {
    return api.get(`/api/Dashboard/tasks`);
  },

};

export default GlobalRepository;
