Skip to content

Conversation

@ntucker
Copy link
Collaborator

@ntucker ntucker commented Nov 28, 2025

Motivation

Sometimes people use POST with body for get requests due to high number of parameters

Solution

Fix getPage types when paginationField is in body

const ep = new RestEndpoint({
  path: '/rpc',
  method: 'POST',
  body: {} as { page?: number; method: string },
  paginationField: 'page',
});
// Before: ep.getPage({ page: 2 }, { method: 'get' }) ❌
// After:  ep.getPage({ page: 2, method: 'get' })     ✓

@changeset-bot
Copy link

changeset-bot bot commented Nov 28, 2025

🦋 Changeset detected

Latest commit: afceb16

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@data-client/rest Patch
test-bundlesize Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ntucker ntucker enabled auto-merge (squash) November 28, 2025 18:20
@ntucker ntucker disabled auto-merge November 28, 2025 18:20
@ntucker ntucker merged commit 63ee107 into master Nov 28, 2025
22 checks passed
@ntucker ntucker deleted the pagination-body branch November 28, 2025 18:21
@github-actions github-actions bot mentioned this pull request Dec 1, 2025
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