diff --git a/js/apps/admin-ui/src/groups/Members.tsx b/js/apps/admin-ui/src/groups/Members.tsx index ea56774a46..84a2a1443c 100644 --- a/js/apps/admin-ui/src/groups/Members.tsx +++ b/js/apps/admin-ui/src/groups/Members.tsx @@ -154,8 +154,8 @@ export const Members = () => { <> {addMembers && ( - await adminClient.groups.listMembers({ id: id! }) + membersQuery={(first, max) => + adminClient.groups.listMembers({ id: id!, first, max }) } onAdd={async (selectedRows) => { try { diff --git a/js/apps/admin-ui/src/groups/MembersModal.tsx b/js/apps/admin-ui/src/groups/MembersModal.tsx index b2a92faf2c..1fb8cf34c9 100644 --- a/js/apps/admin-ui/src/groups/MembersModal.tsx +++ b/js/apps/admin-ui/src/groups/MembersModal.tsx @@ -10,7 +10,7 @@ import { KeycloakDataTable } from "../components/table-toolbar/KeycloakDataTable import { emptyFormatter } from "../util"; type MemberModalProps = { - membersQuery: () => Promise; + membersQuery: (first?: number, max?: number) => Promise; onAdd: (users: UserRepresentation[]) => Promise; onClose: () => void; }; @@ -27,7 +27,7 @@ export const MemberModal = ({ const [selectedRows, setSelectedRows] = useState([]); const loader = async (first?: number, max?: number, search?: string) => { - const members = await membersQuery(); + const members = await membersQuery(first, max); const params: { [name: string]: string | number } = { first: first!, max: max! + members.length, diff --git a/js/apps/admin-ui/src/organizations/Members.tsx b/js/apps/admin-ui/src/organizations/Members.tsx index 9a9912186b..91cd0d8f17 100644 --- a/js/apps/admin-ui/src/organizations/Members.tsx +++ b/js/apps/admin-ui/src/organizations/Members.tsx @@ -72,9 +72,7 @@ export const Members = () => { {openAddMembers && ( - await adminClient.organizations.listMembers({ orgId }) - } + membersQuery={() => adminClient.organizations.listMembers({ orgId })} onAdd={async (selectedRows) => { try { await Promise.all(