import { baseApiRequest } from "../apiRequests/baseApiRequest";

const PROJECT_API = `${process.env.NEXT_PUBLIC_PROJECT_MANAGEMENT_API_URL}/api/v1`;
// const USER_API =
//     "https://ikoncloud-dev.keross.com/ikon-api/platform/user/current";

// READ
export const getGrades = async () => {
  return baseApiRequest(
    `${PROJECT_API}/grades`,
    {
      method: "GET",
      cache: "no-store",
    },
    { isAccessTokenRequird: true },
  );
};

export const getRoles = async () => {
  return baseApiRequest(
    `${PROJECT_API}/roles`,
    {
      method: "GET",
      cache: "no-store",
    },
    { isAccessTokenRequird: true },
  );
};

export const getEmployees = async () => {
  return baseApiRequest(
    `${PROJECT_API}/employees`,
    {
      method: "GET",
      headers: { "Content-Type": "application/json" },
      credentials: "include",
    },
    {
      isAccessTokenRequird: true,
      revalidatePaths: ["/roles"],
    },
  );
};
