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 && (
|
{addMembers && (
|
||||||
<MemberModal
|
<MemberModal
|
||||||
membersQuery={async () =>
|
membersQuery={(first, max) =>
|
||||||
await adminClient.groups.listMembers({ id: id! })
|
adminClient.groups.listMembers({ id: id!, first, max })
|
||||||
}
|
}
|
||||||
onAdd={async (selectedRows) => {
|
onAdd={async (selectedRows) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { KeycloakDataTable } from "../components/table-toolbar/KeycloakDataTable
|
||||||
import { emptyFormatter } from "../util";
|
import { emptyFormatter } from "../util";
|
||||||
|
|
||||||
type MemberModalProps = {
|
type MemberModalProps = {
|
||||||
membersQuery: () => Promise<UserRepresentation[]>;
|
membersQuery: (first?: number, max?: number) => Promise<UserRepresentation[]>;
|
||||||
onAdd: (users: UserRepresentation[]) => Promise<void>;
|
onAdd: (users: UserRepresentation[]) => Promise<void>;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
};
|
};
|
||||||
|
@ -27,7 +27,7 @@ export const MemberModal = ({
|
||||||
const [selectedRows, setSelectedRows] = useState<UserRepresentation[]>([]);
|
const [selectedRows, setSelectedRows] = useState<UserRepresentation[]>([]);
|
||||||
|
|
||||||
const loader = async (first?: number, max?: number, search?: string) => {
|
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 } = {
|
const params: { [name: string]: string | number } = {
|
||||||
first: first!,
|
first: first!,
|
||||||
max: max! + members.length,
|
max: max! + members.length,
|
||||||
|
|
|
@ -72,9 +72,7 @@ export const Members = () => {
|
||||||
<PageSection variant="light">
|
<PageSection variant="light">
|
||||||
{openAddMembers && (
|
{openAddMembers && (
|
||||||
<MemberModal
|
<MemberModal
|
||||||
membersQuery={async () =>
|
membersQuery={() => adminClient.organizations.listMembers({ orgId })}
|
||||||
await adminClient.organizations.listMembers({ orgId })
|
|
||||||
}
|
|
||||||
onAdd={async (selectedRows) => {
|
onAdd={async (selectedRows) => {
|
||||||
try {
|
try {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
|
|
Loading…
Reference in a new issue