-
Notifications
You must be signed in to change notification settings - Fork 91
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
If page is more than totalDocs then empty array #35
Comments
@ruslanguns |
Can you please show me an example of this validation? |
I mean do not snow page 2 if you get hasNextPage = false while getting response from page = 1. |
Oh yes, I understand the work around, I am actually printing an Exception Error when someone is paging to pages that does not exists, however my guess it that the library should validate this arg with a default action as a default, for example, show the last page possible. |
Describe the bug
If I am sending higher page returns empty array.
To Reproduce
Data object is the result from query using paginate-v2. As you can see limit is fine asking for more data in the query, the issue only happens with page (per_page).
Expected behavior
Should return last page available, or validation error.
Screenshots
![image](https://user-images.githubusercontent.com/19806968/61012330-f9dca980-a375-11e9-94f2-bd4ced370466.png)
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: