-
Notifications
You must be signed in to change notification settings - Fork 1
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: show pagination #261
Conversation
if len(maybeResources.Items) == 0 { | ||
return "No items found", nil | ||
} | ||
if !isMultipleResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reversed this check to remove the indentation.
limit int | ||
offset int | ||
) | ||
self, ok := maybeResources.Links["self"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gets the pagination values from the HATEOAS "self" link.
} | ||
} | ||
|
||
if successMessage != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to do some newline + space manipulation to make things work for a single response and multiple responses. We should refactor this to make it easier to reason about.
In a plaintext response that shows multiple items, we now show pagination if there is any.
Requirements
Related issues
Provide links to any issues in this repository or elsewhere relating to this pull request.
Describe the solution you've provided
Provide a clear and concise description of what you expect to happen.
Describe alternatives you've considered
Provide a clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context about the pull request here.