Skip to content

Commit

Permalink
pagination is now working for environment (#4470)
Browse files Browse the repository at this point in the history
Signed-off-by: kanhaiya04 <[email protected]>
  • Loading branch information
kanhaiya04 authored Mar 4, 2024
1 parent 516a7a0 commit 5449439
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions chaoscenter/web/src/controllers/Environments/Environment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() });
Expand All @@ -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'
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 5449439

Please sign in to comment.