add first and max to group member query (#30327)

fixes: #30143

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This commit is contained in:
Erik Jan de Wit 2024-06-14 14:26:19 +02:00 committed by GitHub
parent 8fd6e069a8
commit 716e2d4e68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 7 deletions

View file

@ -154,8 +154,8 @@ export const Members = () => {
<>
{addMembers && (
<MemberModal
membersQuery={async () =>
await adminClient.groups.listMembers({ id: id! })
membersQuery={(first, max) =>
adminClient.groups.listMembers({ id: id!, first, max })
}
onAdd={async (selectedRows) => {
try {

View file

@ -10,7 +10,7 @@ import { KeycloakDataTable } from "../components/table-toolbar/KeycloakDataTable
import { emptyFormatter } from "../util";
type MemberModalProps = {
membersQuery: () => Promise<UserRepresentation[]>;
membersQuery: (first?: number, max?: number) => Promise<UserRepresentation[]>;
onAdd: (users: UserRepresentation[]) => Promise<void>;
onClose: () => void;
};
@ -27,7 +27,7 @@ export const MemberModal = ({
const [selectedRows, setSelectedRows] = useState<UserRepresentation[]>([]);
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,

View file

@ -72,9 +72,7 @@ export const Members = () => {
<PageSection variant="light">
{openAddMembers && (
<MemberModal
membersQuery={async () =>
await adminClient.organizations.listMembers({ orgId })
}
membersQuery={() => adminClient.organizations.listMembers({ orgId })}
onAdd={async (selectedRows) => {
try {
await Promise.all(