Open lostdalek opened 7 years ago
I've found a workaround, default configuration is having routes: { include: ['*'], exclude: [] }
It just need to remove the *
in order to disable the pagination globally
here is my plugin configuration:
plugin: {
register: 'hapi-pagination',
pagination: {
enabled: false
},
options: {
routes: { include: [], exclude: [] }
}
}
I let the issue open, I think that enabled: false
should really disable the plugin without throwing an error :)
Hi,
I'm having Internet issues at the moment I won't be able to look at it right now. If you think you've found a way to solve your issue, I would be happy to accept a PR !
Hi, I don't have the time to dig in the source code at the moment so I provided an example, might be usefull for somebody :)
Hi, not sure if there is a bug or I can't get the configuration right but I would like to disable pagination by default and only enable it on specific route.
this is what i'm trying: plugin registration (with glue)
and enabling it on specific route (it's working great):
but on a route without plugins.pagination configured, I have the following error:
manually setting pagination.enabled = false in the route config is working, but I don't want to explicitly disable on route level and I don't want to maintain a global exclude or include route array in the plugin configuration. I only want to enable when I need on route configuration level
I'm I doing something wrong? thanks!