111 lines
2.8 KiB
TypeScript
111 lines
2.8 KiB
TypeScript
import {
|
|
httpDeleteInterceptor,
|
|
httpGetInterceptor,
|
|
httpPostInterceptor,
|
|
} from "../http-config/http-interceptor-service";
|
|
|
|
export async function getUserListAll() {
|
|
const url = `users/pagination/all?enablePage=0`;
|
|
return httpGetInterceptor(url);
|
|
}
|
|
|
|
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 getAllUsers({
|
|
count = 1,
|
|
limit = 10,
|
|
nextPage = 1,
|
|
page = 1,
|
|
previousPage = 1,
|
|
sort = "desc",
|
|
sortBy = "id",
|
|
totalPage = 10,
|
|
}: {
|
|
count?: number;
|
|
limit?: number;
|
|
nextPage?: number;
|
|
page?: number;
|
|
previousPage?: number;
|
|
sort?: string;
|
|
sortBy?: string;
|
|
totalPage?: number;
|
|
}) {
|
|
const url = `users?count=${count}&limit=${limit}&nextPage=${nextPage}&page=${page}&previousPage=${previousPage}&sort=${sort}&sortBy=${sortBy}&totalPage=${totalPage}`;
|
|
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);
|
|
}
|