This commit is contained in:
Rama Priyanto 2025-02-17 17:18:50 +07:00
parent 1e60384a47
commit 3147e88622
3 changed files with 8 additions and 3 deletions

View File

@ -88,7 +88,7 @@ export default function FormMasterUserRole() {
const formData = { const formData = {
code: data.code, code: data.code,
description: data.description, description: data.description,
statusId: 1, statusId: 2,
userLevelIds: [Number(data.userLevelId)], userLevelIds: [Number(data.userLevelId)],
name: data.name, name: data.name,
userRoleAccess: data.userRoleAccess.map((roleAccess) => { userRoleAccess: data.userRoleAccess.map((roleAccess) => {
@ -99,7 +99,7 @@ export default function FormMasterUserRole() {
isInsertEnabled: roleAccess.isInsertEnabled, isInsertEnabled: roleAccess.isInsertEnabled,
isUpdateEnabled: roleAccess.isUpdateEnabled, isUpdateEnabled: roleAccess.isUpdateEnabled,
isViewEnabled: roleAccess.isViewEnabled, isViewEnabled: roleAccess.isViewEnabled,
menuId: roleAccess.menuId, menuId: 1,
}; };
}), }),
}; };

View File

@ -78,7 +78,7 @@ export default function MasterRoleTable() {
{ name: "Role", uid: "name" }, { name: "Role", uid: "name" },
{ name: "Description", uid: "description" }, { name: "Description", uid: "description" },
{ name: "Code", uid: "code" }, { name: "Code", uid: "code" },
{ name: "Level Number", uid: "level_number" }, // { name: "Level Number", uid: "level_number" },
// { name: "Status Id", uid: "status_id" }, // { name: "Status Id", uid: "status_id" },
{ name: "Aksi", uid: "actions" }, { name: "Aksi", uid: "actions" },
]; ];

View File

@ -4,6 +4,10 @@ import {
httpPost, httpPost,
} from "./http-config/axios-base-service"; } from "./http-config/axios-base-service";
import Cookies from "js-cookie";
const token = Cookies.get("access_token");
export async function listUserRole(data: any) { export async function listUserRole(data: any) {
const headers = { const headers = {
"content-type": "application/json", "content-type": "application/json",
@ -17,6 +21,7 @@ export async function listUserRole(data: any) {
export async function createMasterUserRole(data: any) { export async function createMasterUserRole(data: any) {
const headers = { const headers = {
"content-type": "application/json", "content-type": "application/json",
Authorization: `Bearer ${token}`,
}; };
const pathUrl = `/user-roles`; const pathUrl = `/user-roles`;
return await httpPost(pathUrl, headers, data); return await httpPost(pathUrl, headers, data);