From 5449439d8ca5bf7d2977dc47ebbf86965665f1de Mon Sep 17 00:00:00 2001 From: Kanhaiya yadav <93936630+kanhaiya04@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:00:26 +0530 Subject: [PATCH] pagination is now working for environment (#4470) Signed-off-by: kanhaiya04 --- chaoscenter/web/src/controllers/Environments/Environment.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/chaoscenter/web/src/controllers/Environments/Environment.tsx b/chaoscenter/web/src/controllers/Environments/Environment.tsx index 1bf5d2517ca..2abb02dfd08 100644 --- a/chaoscenter/web/src/controllers/Environments/Environment.tsx +++ b/chaoscenter/web/src/controllers/Environments/Environment.tsx @@ -15,7 +15,7 @@ const EnvironmentController: React.FC = () => { // State for pagination const page = parseInt(searchParams.get('page') ?? '0'); - const limit = parseInt(searchParams.get('limit') ?? '15'); + const limit = parseInt(searchParams.get('limit') ?? '5'); const setPage = (newPage: number): void => updateSearchParams({ page: newPage.toString() }); const setLimit = (newLimit: number): void => updateSearchParams({ limit: newLimit.toString() }); @@ -27,7 +27,7 @@ const EnvironmentController: React.FC = () => { } = listEnvironment({ projectID: scope.projectID, environmentIDs: [], - pagination: { page, limit: 5 }, + pagination: { page, limit }, options: { onError: err => showError(err.message), fetchPolicy: 'cache-first' @@ -57,7 +57,6 @@ const EnvironmentController: React.FC = () => { const environments = envData?.listEnvironments.environments; const totalEnvironments = envData?.listEnvironments.totalNoOfEnvironments; - const environmentTableData: EnvironmentDetailsTableProps | undefined = environments && { content: generateEnvironmentTableContent(environments), pagination: {