fknop / hapi-pagination

Hapi plugin to handle "custom" pagination
MIT License
63 stars 36 forks source link

Question: Hapi 1.17 upgrade plans, required actions? #62

Closed jimutt closed 6 years ago

jimutt commented 6 years ago

Looking to add some pagination to a Hapi 1.17 project but I noticed the big disclaimer: "[NOT UPDATED FOR 1.17]". Are there any plans/work being done on updating this plugin for Hapi 1.17? What changes will be required?

fknop commented 6 years ago

Thanks for asking, PR would be welcome, I don't really have time to update this with my studies.

I don't think it'll require too much change, but you would need to read the patch note for hapi 1.17 related to plugins.

It might even work, I didn't try it to be honest, but as Hapi 1.17 is a big breaking change update, I'm just making sure that people know that it's not updated yet if it requires changes.

jimutt commented 6 years ago

Alright, if I'm able to find some time I'll maybe have a look at it (no promises though). :)

jimutt commented 6 years ago

Got 42 tests passing now, most work is adapting all the test cases to the new async/await flow.

microcipcip commented 6 years ago

@jimutt I have installed the plugin and copied-pasted the options object from the readme and I got child "reply" fails because ["totalCount" is not allowed]

fknop commented 6 years ago

Yes, I'm sorry, the README is out of date. In the meantime, you can check here the real schema here: https://github.com/fknop/hapi-pagination/blob/master/lib/config.js#L67

totalCount is under parameters and not directly under reply. I think this is why you have this error.

microcipcip commented 6 years ago

Thanks, it works now :)