690328:1703 Fixing Refactor uuid by Kimi #11
CI / CD Pipeline / build (push) Successful in 8m10s
CI / CD Pipeline / deploy (push) Successful in 4m26s

This commit is contained in:
2026-03-28 17:03:12 +07:00
parent 57a3ed2d37
commit 7a9a15560b
15 changed files with 82 additions and 54 deletions
@@ -10,7 +10,8 @@ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import apiClient from '@/lib/api/client';
interface Role {
roleId: number;
publicId?: string; // ADR-019: public identifier
roleId?: number; // Internal INT
roleName: string;
permissions?: Permission[];
}
@@ -151,16 +152,17 @@ export function RbacMatrix() {
<div className="text-xs text-muted-foreground">{perm.description}</div>
</TableCell>
{roleList.map((role) => {
const roleId = role.roleId ?? 0;
// Assume role.permissions is populated
const currentRolePerms = role.permissions?.map((p) => p.permissionId) || [];
const activePerms = pendingChanges[role.publicId] || currentRolePerms;
const activePerms = pendingChanges[roleId] || currentRolePerms;
const isChecked = activePerms.includes(perm.permissionId);
return (
<TableCell key={`${role.publicId}-${perm.permissionId}`} className="text-center">
<TableCell key={`${roleId}-${perm.permissionId}`} className="text-center">
<Checkbox
checked={isChecked}
onCheckedChange={() => handleToggle(role.publicId, perm.permissionId, currentRolePerms)}
onCheckedChange={() => handleToggle(roleId, perm.permissionId, currentRolePerms)}
/>
</TableCell>
);