use ui ext groups endpoint (#20772)
so that we have filtering for fine grained groups fixes: https://github.com/keycloak/keycloak/issues/19655#issuecomment-1573350358
This commit is contained in:
parent
a61b1e7fb2
commit
db315b59f6
1 changed files with 11 additions and 5 deletions
|
@ -24,6 +24,7 @@ import { PaginatingTableToolbar } from "../table-toolbar/PaginatingTableToolbar"
|
|||
import { GroupPath } from "./GroupPath";
|
||||
|
||||
import "./group-picker-dialog.css";
|
||||
import { fetchAdminUI } from "../../context/auth/admin-ui-endpoint";
|
||||
|
||||
export type GroupPickerDialogProps = {
|
||||
id?: string;
|
||||
|
@ -72,11 +73,16 @@ export const GroupPickerDialog = ({
|
|||
let existingUserGroups;
|
||||
let count = 0;
|
||||
if (!groupId) {
|
||||
groups = await adminClient.groups.find({
|
||||
first,
|
||||
max: max + (isSearching ? 0 : 1),
|
||||
search: isSearching ? filter : "",
|
||||
});
|
||||
groups = await fetchAdminUI<GroupRepresentation[]>(
|
||||
"ui-ext/groups",
|
||||
Object.assign(
|
||||
{
|
||||
first: `${first}`,
|
||||
max: `${max + 1}`,
|
||||
},
|
||||
isSearching ? null : { search: filter }
|
||||
)
|
||||
);
|
||||
} else if (!navigation.map(({ id }) => id).includes(groupId)) {
|
||||
group = await adminClient.groups.findOne({ id: groupId });
|
||||
if (!group) {
|
||||
|
|
Loading…
Reference in a new issue