mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
Selected client ID is a string and not an array
Closes #41080 Signed-off-by: Pedro Igor <pigor.craveiro@gmail.com>
This commit is contained in:
parent
2f36276ff0
commit
03a95ef395
@ -100,16 +100,20 @@ const PermissionEvaluateContent = ({ client }: Props) => {
|
||||
}
|
||||
|
||||
const formValues = getValues();
|
||||
const getSingleValue = (source: string | string[]) => {
|
||||
return Array.isArray(source) ? source?.[0] : source;
|
||||
};
|
||||
|
||||
const getResourceName = (resourceType: string) => {
|
||||
switch (resourceType) {
|
||||
case "Groups":
|
||||
return formValues.groups?.[0];
|
||||
return getSingleValue(formValues.groups);
|
||||
case "Users":
|
||||
return formValues.users?.[0];
|
||||
return getSingleValue(formValues.users);
|
||||
case "Clients":
|
||||
return formValues.clients?.[0];
|
||||
return getSingleValue(formValues.clients);
|
||||
case "Roles":
|
||||
return formValues.roles?.[0];
|
||||
return getSingleValue(formValues.roles);
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user