web-mikul-news/service/master-user-role.ts

30 lines
852 B
TypeScript
Raw Normal View History

2025-07-02 15:44:00 +00:00
import Cookies from "js-cookie";
2025-07-03 17:18:54 +00:00
import { httpDeleteInterceptor, httpGetInterceptor, httpPostInterceptor } from "./http-config/http-interceptor-services";
2025-07-02 15:44:00 +00:00
const token = Cookies.get("access_token");
export async function listUserRole(data: any) {
2025-07-03 17:18:54 +00:00
return await httpGetInterceptor(
`/user-roles?limit=${data.limit}&page=${data.page}`
2025-07-02 15:44:00 +00:00
);
}
export async function createMasterUserRole(data: any) {
const pathUrl = `/user-roles`;
2025-07-03 17:18:54 +00:00
return await httpPostInterceptor(pathUrl, data);
2025-07-02 15:44:00 +00:00
}
export async function getMasterUserRoleById(id: any) {
const headers = {
"content-type": "application/json",
};
2025-07-03 17:18:54 +00:00
return await httpGetInterceptor(`/user-roles/${id}`);
2025-07-02 15:44:00 +00:00
}
export async function deleteMasterUserRole(id: string) {
const headers = {
"content-type": "application/json",
};
2025-07-03 17:18:54 +00:00
return await httpDeleteInterceptor(`/user-roles/${id}`);
2025-07-02 15:44:00 +00:00
}