sort the role list alfabaticlly (#346)
This commit is contained in:
parent
64f622139c
commit
45a6f9923d
1 changed files with 13 additions and 1 deletions
|
@ -110,7 +110,19 @@ export const ClientDetails = () => {
|
|||
const [client, setClient] = useState<ClientRepresentation>();
|
||||
|
||||
const loader = async () => {
|
||||
return await adminClient.clients.listRoles({ id });
|
||||
const roles = await adminClient.clients.listRoles({ id });
|
||||
return roles.sort((r1, r2) => {
|
||||
const r1Name = r1.name?.toUpperCase();
|
||||
const r2Name = r2.name?.toUpperCase();
|
||||
if (r1Name! < r2Name!) {
|
||||
return -1;
|
||||
}
|
||||
if (r1Name! > r2Name!) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
};
|
||||
|
||||
const [toggleDeleteDialog, DeleteConfirm] = useConfirmDialog({
|
||||
|
|
Loading…
Reference in a new issue