import {
  httpDeleteInterceptor,
  httpGetInterceptor,
  httpPostInterceptor,
} from "../http-config/http-interceptor-service";

export async function AdministrationUserList(
  id: string,
  page: number,
  name = "",
  size: string,
  featureId: string,
  role = ""
) {
  const url = `users/pagination/internal?enablePage=1&size=${size}&page=${page}&levelId=${id}&name=${name}&featureId=${featureId}&roleFilter=${role}`;
  return httpGetInterceptor(url);
}

export async function AdministrationLevelList() {
  const url = "users/user-levels/list";
  return httpGetInterceptor(url);
}

export async function getListEducation() {
  const url = "users/user-educations/list";
  return httpGetInterceptor(url);
}

export async function getListSchools() {
  const url = "users/user-schools/list";
  return httpGetInterceptor(url);
}
export async function getListCompetencies() {
  const url = "users/user-competencies/list";
  return httpGetInterceptor(url);
}

export async function saveUserInternal(data: any) {
  const url = "users/save";
  return httpPostInterceptor(url, data);
}

export async function getUserById(id: string) {
  const url = `users?id=${id}`;
  return httpGetInterceptor(url);
}

export async function disableUser(userId: number | string) {
  const url = `users/disable-user?userId=${userId}`;
  return httpPostInterceptor(url);
}

export async function deleteUser(userId: number | string) {
  const url = `users/delete-user?userId=${userId}`;
  return httpDeleteInterceptor(url);
}
