-
Notifications
You must be signed in to change notification settings - Fork 35
Description
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)
registrations: [
{
plugin: {
register: 'hapi-pagination',
pagination: {
enabled: false
}
}, ...
and enabling it on specific route (it's working great):
method: 'GET',
path: '/paginatedResource',
config: {
plugins: {
pagination: {
enabled: true,
limit: this.paginationLimit
},
}
},
handler: ...
but on a route without plugins.pagination configured, I have the following error:
server-0 | Debug: internal, implementation, error
server-0 | Error: Uncaught error: The results must be an array
server-0 | at Object.exports.assert (xxxxx/node_modules/hoek/lib/index.js:736:11)
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!