import api from "src/api";

export const getStudents = async () => {
  const { data } = await api.get("/student");
  return data.payload;
};

export const getStudentSummaryFranchisor = async (unitIds = []) => {
  const { data } = await api.get("/student/franchisor/summary", {
    params: unitIds.length ? { unit_ids: unitIds } : {},
  });
  return data.payload;
};

export const getFranchisorActiveStudents = async (unitIds = []) => {
  const { data } = await api.get("/student/franchisor/active", {
    params: unitIds.length ? { unit_ids: unitIds } : {},
  });
  return data.payload;
};

export const getFranchisorStudentDetail = async (id) => {
  const { data } = await api.get(`/student/franchisor/${id}`);
  return data.payload;
};
