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:
parent
8fd6e069a8
commit
716e2d4e68
3 changed files with 5 additions and 7 deletions
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue