Browse Source

fix broken user role dialog

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 year ago
parent
commit
4e9b2164b0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      client/src/pages/user/UpdateUserRole.tsx

+ 2 - 2
client/src/pages/user/UpdateUserRole.tsx

@@ -50,9 +50,9 @@ const UpdateUserRole: FC<UpdateUserRoleProps> = ({
   };
 
   const fetchAllRoles = async () => {
-    const roles = (await UserHttp.getRoles()) as RoleOptions;
+    const roles = await UserHttp.getRoles();
 
-    setRoleOptions(roles.map((r: any) => r.role.name));
+    setRoleOptions(roles.results.map((r: any) => r.role.name));
   };
 
   useEffect(() => {