mediahub-fe/service/management-user/management-user.ts

83 lines
2.2 KiB
TypeScript

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 getListExperiences() {
const url = "users/user-experiences/list";
return httpGetInterceptor(url);
}
export async function saveUserInternal(data: any) {
const url = "users/save";
return httpPostInterceptor(url, data);
}
export async function checkRolePlacementsAvailability(data: any) {
const url = "users/role-placements/availability";
return httpPostInterceptor(url, data);
}
export async function saveUserRolePlacements(data: any) {
const url = "users/role-placements";
return httpPostInterceptor(url, data);
}
export async function getUserRolePlacements(userId: number) {
const url = `users/role-placements?userId=${userId}`;
return httpGetInterceptor(url);
}
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);
}
export async function getOperatorUser(typeId: any) {
const url = `users/search-operator-user?code=opt-id&typeId=${typeId}`;
return httpGetInterceptor(url);
}