update user detail
This commit is contained in:
@@ -13,7 +13,8 @@ export const moduleCode: ModuleCode = "GAO";
|
||||
const pageSize = 1000;
|
||||
|
||||
export type Permission = UserPermission;
|
||||
export type Role = UserRole & {
|
||||
export type Role = Omit<UserRole, "id" | "permissionIdList" | "childRoleIdList"> & {
|
||||
id: string;
|
||||
permissionIdList: string[];
|
||||
childRoleIdList: string[];
|
||||
};
|
||||
@@ -40,10 +41,11 @@ export type PermissionDraft = {
|
||||
function normalizeRole(role: UserRole): Role {
|
||||
return {
|
||||
...role,
|
||||
id: role.id || "",
|
||||
moduleCode: role.moduleCode || moduleCode,
|
||||
description: role.description || "",
|
||||
permissionIdList: role.permissionIdList || role.permissionList?.map(item => item.id) || [],
|
||||
childRoleIdList: role.childRoleIdList || role.childRoleList?.map(item => item.id) || []
|
||||
childRoleIdList: role.childRoleIdList || role.childRoleList?.map(item => item.id).filter((id): id is string => Boolean(id)) || []
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user