-
Notifications
You must be signed in to change notification settings - Fork 4
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: cursor-based pagination for payments and tasks #81
Conversation
Signed-off-by: Lawrence Zawila <113581282+darkmatterpool@users.noreply.github.com>
Codecov Report
@@ Coverage Diff @@
## main #81 +/- ##
==========================================
+ Coverage 19.41% 19.76% +0.35%
==========================================
Files 104 103 -1
Lines 4600 4674 +74
==========================================
+ Hits 893 924 +31
- Misses 3607 3646 +39
- Partials 100 104 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
internal/app/api/connector.go
Outdated
HasMore: paginationDetails.HasMore, | ||
Previous: paginationDetails.PreviousPage, | ||
Next: paginationDetails.NextPage, | ||
Data: nil, |
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.
When using cursor, data must be here.
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.
Fixed
internal/app/api/connector.go
Outdated
Data: &data, | ||
Cursor: &sharedapi.Cursor[[]listTasksResponseElement]{ | ||
PageSize: paginationDetails.PageSize, | ||
Total: sharedapi.Total{ |
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.
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.
Fixed
swagger.yml
Outdated
description: How many payments to skip, pagination can be achieved in conjunction with 'limit' parameter. | ||
example: 100 | ||
type: string | ||
description: Cursor for pagination. |
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.
Can you please add details on how to use it?
For instance in the ledger I wrote this description:
"Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when the pagination token is set."
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.
Fixed
Signed-off-by: Lawrence Zawila <113581282+darkmatterpool@users.noreply.github.com>
Signed-off-by: Lawrence Zawila <113581282+darkmatterpool@users.noreply.github.com>
Signed-off-by: Lawrence Zawila <113581282+darkmatterpool@users.noreply.github.com>
Signed-off-by: Lawrence Zawila <113581282+darkmatterpool@users.noreply.github.com>
Signed-off-by: Lawrence Zawila 113581282+darkmatterpool@users.noreply.github.com