Apply pagination macro to all requests #78
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)
Fixes #59.
Applies the pagination macro in all endpoints (except accounts, see below), and removes duplicate code. Some tests needed to be updated slightly (for example,
unwrap
needed to be appended in some locations.Adds a check in the pagination macro itself (
set_cursor
), which was previously present in some pagination implementations. This way, one uniform error message will always be returned.Updates relevant documentation examples with the addition of required crate imports for the macro.
Note: Accounts endpoint still needs to be refactored, but the pagination macro needs to be updated first, due to generics. See #70.
Similar implementations of pagination functionality are present in some endpoints, which results in duplicate code. Also, there are minor differences between these implementation, leading to inconsistencies.
🆕 What is the new behavior (if this is a feature change)?
Common code for pagination is injected with a derive macro, rather than implemented wherever required.
💥 Does this PR introduce a breaking change?
No.
🤔 Checklist before submitting