Added a custom route option to override whether pagination is on or off#7
Merged
fknop merged 1 commit intofknop:masterfrom Dec 22, 2015
Merged
Conversation
Author
|
We can also use the plugin options to override other options in the future, such as changing the name of the 'results' depending on the route. e.g. 'users' or 'accounts'. |
Owner
|
I think I'm gonna replace the following by route options |
Owner
|
I will need more time for this one if that's ok for you. I have some ideas but I'll do that later. I merged the other PR and fixed your issue. |
Author
|
That's fine it's not very urgent for me. In addition to being able to enable/disabled, I was just thinking maybe you could override the existing options at the controller config level as well. You can reuse the same options structure for consistency. |
Owner
|
Hi, it's done. Version 1.6.0 is on npm :) ! |
Author
|
Great work! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This allows you to configure if pagination is applied at the route definition using the hapi plugin options.
E.g.
config: {
plugins: {
pagination: { enabled: true }
},
handler: (request, reply) => reply([])
}
This overrides the global include/exclude array settings, and allows us not to care about actual paths.