import apiClient from "./apiClient";
// export const getAllJurors = () => apiClient.get("/api/juror/jurors/");
export const getAllJurors = (params = {}) =>
  apiClient.get("/api/juror/jurors/", { params });
export const getAllJurorsAssigned = (params = {}) =>
  apiClient.get("/api/juror/jurors/assigned-list/", { params });
export const getJurorSocialLinks = (jurorId) =>
  apiClient.get(`api/juror/jurors/${jurorId}/social-media-links/`);
export const exportJurorCsv = (jurorId) =>
  apiClient.get(`api/juror/jurors/${jurorId}/export-csv/`);
export const addUpdateSocialLinks = (jurorId, formData) =>
  apiClient.post(`api/juror/jurors/${jurorId}/social-media-links/`, formData, {
    headers: { "Content-Type": "multipart/form-data" },
  });
export const getAllEducationLevels = () =>
  apiClient.get("/api/juror/education-levels/");
export const getAllStates = () => apiClient.get("/api/juror/states/");
// export const createJurors = (formData) =>
//   apiClient.post("/api/juror/jurors/", formData, {
//     headers: { "Content-Type": "multipart/form-data" },
//   });

export const createJurors = (formData) =>
  apiClient.post("/api/juror/jurors/", formData, {
    headers: { "Content-Type": "multipart/form-data" },
  });

export const importJurors = (formData) =>
  apiClient.post("/api/juror/jurors/import-csv/", formData, {
    headers: { "Content-Type": "multipart/form-data" },
  });

export const getJurorById = (id) => apiClient.get(`/api/juror/jurors/${id}/`);

export const updateJuror = (id, formData) =>
  apiClient.put(`/api/juror/jurors/${id}/`, formData, {
    headers: { "Content-Type": "multipart/form-data" },
  });

export const deleteJuror = (id) => apiClient.delete(`/api/juror/jurors/${id}/`);

export const runIdiReport = (formData) =>
  apiClient.post(`/api/case/idi-report/search/`, formData, {
    headers: { "Content-Type": "multipart/form-data" },
  });

export const assignUnassignedJurorsToAnalyst = (payload) =>
  apiClient.post("/api/case/assign-jurors-to-analyst/", payload);
