Skip to content

Increase page size to 30 for contract programs#3036

Merged
jkachel merged 2 commits intomainfrom
jkachel/10480-increase-program-page-size
Mar 11, 2026
Merged

Increase page size to 30 for contract programs#3036
jkachel merged 2 commits intomainfrom
jkachel/10480-increase-program-page-size

Conversation

@jkachel
Copy link
Contributor

@jkachel jkachel commented Mar 10, 2026

What are the relevant tickets?

Closes mitodl/hq#10480

Description (What does it do?)

Adds page_size to the calls to retrieve programs associated with a contract, and sets that to 30. Per the original issue, there's one case (that we know of) where the API fetches more than a single page of results; while this is due to an error in the API, it would probably be good if we also increased the page size anyway, in case we end up with a contract that has a bunch of programs in it.

How can this be tested?

Load up the dashboard for a contract that has programs - you should see that the calls to the API include page_size=30.

Additional Context

We've hard-coded this in a similar fashion for courses. There, we set it to 200; that's a bit overkill for programs so I went with 30.

@jkachel jkachel added the Needs Review An open Pull Request that is ready for review label Mar 10, 2026
)
const programsQuery = useQuery(
programsQueries.programsList({ org_id: orgId, contract_id: contract.id }),
programsQueries.programsList({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is elsewhere in this file...

  const programsQuery = useQuery({
    ...programsQueries.programsList({
      id: programIds,
      contract_id: contractId,
    }),
    enabled: programIds.length > 0,
  })

which I think fetches the programs belonging to a program collections.

I guess that could exceed 12, too. I tend to do page_size: programIds.length in this scenario.

@jkachel jkachel merged commit 1c6ba7e into main Mar 11, 2026
14 checks passed
@jkachel jkachel deleted the jkachel/10480-increase-program-page-size branch March 11, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants