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 { GroupPath } from "./GroupPath";
|
||||||
|
|
||||||
import "./group-picker-dialog.css";
|
import "./group-picker-dialog.css";
|
||||||
|
import { fetchAdminUI } from "../../context/auth/admin-ui-endpoint";
|
||||||
|
|
||||||
export type GroupPickerDialogProps = {
|
export type GroupPickerDialogProps = {
|
||||||
id?: string;
|
id?: string;
|
||||||
|
@ -72,11 +73,16 @@ export const GroupPickerDialog = ({
|
||||||
let existingUserGroups;
|
let existingUserGroups;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
if (!groupId) {
|
if (!groupId) {
|
||||||
groups = await adminClient.groups.find({
|
groups = await fetchAdminUI<GroupRepresentation[]>(
|
||||||
first,
|
"ui-ext/groups",
|
||||||
max: max + (isSearching ? 0 : 1),
|
Object.assign(
|
||||||
search: isSearching ? filter : "",
|
{
|
||||||
});
|
first: `${first}`,
|
||||||
|
max: `${max + 1}`,
|
||||||
|
},
|
||||||
|
isSearching ? null : { search: filter }
|
||||||
|
)
|
||||||
|
);
|
||||||
} else if (!navigation.map(({ id }) => id).includes(groupId)) {
|
} else if (!navigation.map(({ id }) => id).includes(groupId)) {
|
||||||
group = await adminClient.groups.findOne({ id: groupId });
|
group = await adminClient.groups.findOne({ id: groupId });
|
||||||
if (!group) {
|
if (!group) {
|
||||||
|
|
Loading…
Reference in a new issue