Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat, typescript): support hasNextPage property for offset pagination #4288

Merged
merged 5 commits into from
Aug 12, 2024

Conversation

dsinghvi
Copy link
Member

This PR upgrades the TypeScript IR by a minor version and adds support for looking at a hasNextPage property for pagination.

@dsinghvi dsinghvi marked this pull request as ready for review August 12, 2024 21:19
@@ -532,7 +532,7 @@ export class Users {
let _offset = request?.page != null ? request?.page : 1;
return new core.Pageable<SeedPagination.ListUsersPaginationResponse, SeedPagination.User>({
response: await list(request),
hasNextPage: (response) => (response?.data ?? []).length > 0,
hasNextPage: (response) => response?.hasNextPage ?? (response?.data ?? []).length > 0,
Copy link
Member Author

Choose a reason for hiding this comment

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

core change

Copy link
Contributor

Choose a reason for hiding this comment

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

Sweet, deferring to the length check is great 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants