Realm roles: fix pagination by 10 (#367)
* fix pagination by 10 * fix types * format * format * PR feedback from Erik
This commit is contained in:
parent
689e01b461
commit
93d5d21894
2 changed files with 6 additions and 6 deletions
|
@ -6,9 +6,9 @@ import { RolesList } from "./RolesList";
|
||||||
|
|
||||||
export const RealmRolesSection = () => {
|
export const RealmRolesSection = () => {
|
||||||
const adminClient = useAdminClient();
|
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 } = {
|
const params: { [name: string]: string | number } = {
|
||||||
to: to!,
|
first: first!,
|
||||||
max: max!,
|
max: max!,
|
||||||
search: search!,
|
search: search!,
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,13 +13,13 @@ import { useConfirmDialog } from "../components/confirm-dialog/ConfirmDialog";
|
||||||
import { emptyFormatter, boolFormatter } from "../util";
|
import { emptyFormatter, boolFormatter } from "../util";
|
||||||
|
|
||||||
type RolesListProps = {
|
type RolesListProps = {
|
||||||
loader: (
|
paginated?: boolean;
|
||||||
|
parentRoleId?: string;
|
||||||
|
loader?: (
|
||||||
first?: number,
|
first?: number,
|
||||||
max?: number,
|
max?: number,
|
||||||
search?: string
|
search?: string
|
||||||
) => Promise<RoleRepresentation[]>;
|
) => Promise<RoleRepresentation[]>;
|
||||||
paginated?: boolean;
|
|
||||||
parentRoleId?: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const RolesList = ({
|
export const RolesList = ({
|
||||||
|
@ -75,7 +75,7 @@ export const RolesList = ({
|
||||||
<DeleteConfirm />
|
<DeleteConfirm />
|
||||||
<KeycloakDataTable
|
<KeycloakDataTable
|
||||||
key={selectedRole ? selectedRole.id : "roleList"}
|
key={selectedRole ? selectedRole.id : "roleList"}
|
||||||
loader={loader}
|
loader={loader!}
|
||||||
ariaLabelKey="roles:roleList"
|
ariaLabelKey="roles:roleList"
|
||||||
searchPlaceholderKey="roles:searchFor"
|
searchPlaceholderKey="roles:searchFor"
|
||||||
isPaginated={paginated}
|
isPaginated={paginated}
|
||||||
|
|
Loading…
Reference in a new issue