Realm roles: fix pagination by 10 (#367)

* fix pagination by 10

* fix types

* format

* format

* PR feedback from Erik
This commit is contained in:
Eugenia 2021-02-18 01:38:23 -05:00 committed by GitHub
parent 689e01b461
commit 93d5d21894
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -6,9 +6,9 @@ import { RolesList } from "./RolesList";
export const RealmRolesSection = () => {
const adminClient = useAdminClient();
const loader = async (to?: number, max?: number, search?: string) => {
const loader = async (first?: number, max?: number, search?: string) => {
const params: { [name: string]: string | number } = {
to: to!,
first: first!,
max: max!,
search: search!,
};

View file

@ -13,13 +13,13 @@ import { useConfirmDialog } from "../components/confirm-dialog/ConfirmDialog";
import { emptyFormatter, boolFormatter } from "../util";
type RolesListProps = {
loader: (
paginated?: boolean;
parentRoleId?: string;
loader?: (
first?: number,
max?: number,
search?: string
) => Promise<RoleRepresentation[]>;
paginated?: boolean;
parentRoleId?: string;
};
export const RolesList = ({
@ -75,7 +75,7 @@ export const RolesList = ({
<DeleteConfirm />
<KeycloakDataTable
key={selectedRole ? selectedRole.id : "roleList"}
loader={loader}
loader={loader!}
ariaLabelKey="roles:roleList"
searchPlaceholderKey="roles:searchFor"
isPaginated={paginated}