Increase page size to 30 for contract programs#3036
Merged
Conversation
…ts, so we get a few more back
| ) | ||
| const programsQuery = useQuery( | ||
| programsQueries.programsList({ org_id: orgId, contract_id: contract.id }), | ||
| programsQueries.programsList({ |
Contributor
There was a problem hiding this comment.
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.
ChristopherChudzicki
approved these changes
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
Closes mitodl/hq#10480
Description (What does it do?)
Adds
page_sizeto 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.