removed invalid search (#16913)
fixes: https://github.com/keycloak/keycloak-ui/issues/4320
This commit is contained in:
parent
055b7c3b16
commit
d0828148a2
1 changed files with 4 additions and 7 deletions
|
@ -57,15 +57,12 @@ public class GroupsResource {
|
|||
@QueryParam("exact") @DefaultValue("false") boolean exact) {
|
||||
this.auth.groups().requireList();
|
||||
final Stream<GroupModel> stream;
|
||||
if (!"".equals(search)) {
|
||||
if (global) {
|
||||
stream = session.groups().searchForGroupByNameStream(realm, search, exact, first, max);
|
||||
stream = session.groups().searchForGroupByNameStream(realm, search.trim(), exact, first, max);
|
||||
} else {
|
||||
stream = this.realm.getTopLevelGroupsStream().filter(g -> g.getName().contains(search)).skip(first).limit(max);
|
||||
}
|
||||
} else {
|
||||
stream = this.realm.getTopLevelGroupsStream(first, max);
|
||||
}
|
||||
|
||||
return stream.map(g -> toGroupHierarchy(g, search, exact));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue