From 6a07c091b7e8206fdf6d5855e8e1a4cbc51c26af Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Thu, 21 Apr 2022 16:53:30 +0200 Subject: [PATCH] First and max need to requery (#2450) --- src/clients/authorization/Permissions.tsx | 6 +++--- src/clients/authorization/Policies.tsx | 4 ++-- src/clients/authorization/Resources.tsx | 4 ++-- src/clients/authorization/Scopes.tsx | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/clients/authorization/Permissions.tsx b/src/clients/authorization/Permissions.tsx index 8e6cae5e83..eba6a23b24 100644 --- a/src/clients/authorization/Permissions.tsx +++ b/src/clients/authorization/Permissions.tsx @@ -37,9 +37,9 @@ import { EmptyPermissionsState } from "./EmptyPermissionsState"; import { toNewPermission } from "../routes/NewPermission"; import { toPermissionDetails } from "../routes/PermissionDetails"; import { ListEmptyState } from "../../components/list-empty-state/ListEmptyState"; +import { toPolicyDetails } from "../routes/PolicyDetails"; import "./permissions.css"; -import { toPolicyDetails } from "../routes/PolicyDetails"; type PermissionsProps = { clientId: string; @@ -93,7 +93,7 @@ export const AuthorizationPermissions = ({ clientId }: PermissionsProps) => { async () => { const permissions = await adminClient.clients.findPermissions({ first, - max, + max: max + 1, id: clientId, ...search, }); @@ -115,7 +115,7 @@ export const AuthorizationPermissions = ({ clientId }: PermissionsProps) => { ); }, setPermissions, - [key, search] + [key, search, first, max] ); useFetch( diff --git a/src/clients/authorization/Policies.tsx b/src/clients/authorization/Policies.tsx index 781973e2e8..bbdffd5ccf 100644 --- a/src/clients/authorization/Policies.tsx +++ b/src/clients/authorization/Policies.tsx @@ -72,7 +72,7 @@ export const AuthorizationPolicies = ({ clientId }: PoliciesProps) => { async () => { const policies = await adminClient.clients.listPolicies({ first, - max, + max: max + 1, id: clientId, permission: "false", ...search, @@ -101,7 +101,7 @@ export const AuthorizationPolicies = ({ clientId }: PoliciesProps) => { ); setPolicies(policies); }, - [key, search] + [key, search, first, max] ); const DependentPoliciesRenderer = ({ diff --git a/src/clients/authorization/Resources.tsx b/src/clients/authorization/Resources.tsx index 15edf320fe..3662ff41f4 100644 --- a/src/clients/authorization/Resources.tsx +++ b/src/clients/authorization/Resources.tsx @@ -66,7 +66,7 @@ export const AuthorizationResources = ({ clientId }: ResourcesProps) => { () => { const params = { first, - max, + max: max + 1, deep: false, ...search, }; @@ -79,7 +79,7 @@ export const AuthorizationResources = ({ clientId }: ResourcesProps) => { setResources( resources.map((resource) => ({ ...resource, isExpanded: false })) ), - [key, search] + [key, search, first, max] ); const UriRenderer = ({ row }: { row: ResourceRepresentation }) => ( diff --git a/src/clients/authorization/Scopes.tsx b/src/clients/authorization/Scopes.tsx index 65c04385b6..856a7d2c99 100644 --- a/src/clients/authorization/Scopes.tsx +++ b/src/clients/authorization/Scopes.tsx @@ -66,7 +66,7 @@ export const AuthorizationScopes = ({ clientId }: ScopesProps) => { async () => { const params = { first, - max, + max: max + 1, deep: false, name: search, }; @@ -93,7 +93,7 @@ export const AuthorizationScopes = ({ clientId }: ScopesProps) => { ); }, setScopes, - [key, search] + [key, search, first, max] ); const ResourceRenderer = ({