web-humas-fe/service/master-user-role.ts

35 lines
816 B
TypeScript

import {
httpDeleteInterceptor,
httpGet,
httpPost,
} from "./http-config/axios-base-service";
export async function listUserRole(data: any) {
const headers = {
"content-type": "application/json",
};
return await httpGet(
`/user-roles?limit=${data.limit}&page=${data.page}`,
headers
);
}
export async function createMasterUserRole(data: any) {
const headers = {
"content-type": "application/json",
};
const pathUrl = `/user-roles`;
return await httpPost(pathUrl, headers, data);
}
export async function getMasterUserRoleById(id: any) {
const headers = {
"content-type": "application/json",
};
return await httpGet(`/user-roles/${id}`, headers);
}
export async function deleteMasterUserRole(id: string) {
return await httpDeleteInterceptor(`/user-roles/${id}`);
}