Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Previous and Self links do not work when default is 0 #81

Open
dumbbaldmonkey opened this issue Mar 3, 2020 · 2 comments
Open

Previous and Self links do not work when default is 0 #81

dumbbaldmonkey opened this issue Mar 3, 2020 · 2 comments

Comments

@dumbbaldmonkey
Copy link

dumbbaldmonkey commented Mar 3, 2020

When setting a default page of 0, which is what Postgres uses as its first page, the self/preivous links are not working as expected.

The self link is null and the previous link goes to page=-1

This is due to the if(!page) check in the getUri method. Could this be changed to be < the default value? I can make a PR if you think this is a reasonable fix.

@icenine457
Copy link
Contributor

I believe this PR addresses your concerns (I ran into this issue myself):
#83

It introduces an boolean option at the root of the configuration to allow for using a zero index when paginating. I've defaulted it to false in order to ensure backwards-compatibility, and included tests demonstrating the behavior when it is both false and true.

@icenine457
Copy link
Contributor

@dumbbaldmonkey Looks like the related PR was merged FYI (thanks @fknop!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants