Skip to content

fix(calagopus): paginate admin list endpoints beyond 100 items - #7

Merged
0x7d8 merged 1 commit into
calagopus:mainfrom
Partymann2000:patch-1
Nov 26, 2026
Merged

0x7d8 merged 1 commit into
calagopus:mainfrom
Partymann2000:patch-1

Conversation

@Partymann2000

Copy link
Copy Markdown
Contributor

Summary

getNests(), getEggs(), getLocations(), and getNodes() previously only fetched page 1 with per_page=100. On panels with more than 100 entries (for example, a nest containing 100+ eggs), any items beyond the first page were missing from the product configuration dropdowns.

Changes

  • Add a shared CalagopusAPI::getAllPages() helper that iterates through paginated admin endpoints until all reported total items are fetched or an empty page is returned (capped at maxPages = 50 as a safeguard)
  • Update getNests(), getEggs(), getNodes(), and getUserOwnedServers() to use getAllPages()
  • Update getLocations(?int $perPage = null) to fetch all pages by default while keeping single-page support when an explicit $perPage is passed (such as getLocations(perPage: 1) in testConfig())

## Summary
`getNests()`, `getEggs()`, `getLocations()`, and `getNodes()` previously only fetched page 1 with `per_page=100`. On panels with more than 100 entries (for example, a nest containing 100+ eggs), any items beyond the first page were missing from the product configuration dropdowns.

## Changes
- Add a shared `CalagopusAPI::getAllPages()` helper that iterates through paginated admin endpoints until all reported `total` items are fetched or an empty page is returned (capped at `maxPages = 50` as a safeguard)
- Update `getNests()`, `getEggs()`, `getNodes()`, and `getUserOwnedServers()` to use `getAllPages()`
- Update `getLocations(?int $perPage = null)` to fetch all pages by default while keeping single-page support when an explicit `$perPage` is passed (such as `getLocations(perPage: 1)` in `testConfig()`)
@0x7d8
0x7d8 merged commit fe970b0 into calagopus:main Nov 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants