-
Notifications
You must be signed in to change notification settings - Fork 129
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
Pagination is show older rows again #95
Comments
encountering the same issue |
It might that be that when you ask for a page larger than the last one, it'll give you the last one. So for example if there's 3 pages, and you ask for 100th page, it'll give you results from the 3rd page. ... which I agree, is surprising to me. Maybe it should return no results in such a case? |
yes, it should return no data in such case. |
I had this problem also. The solution is a bit hidden, but possible with the current implementation. When you defmodule MyRepo.Repo do
use Scrivener, options: [allow_overflow_page_number: true]
# ...
end The next time you query a page greater than the total pages, it will return an empty list for iex(1)> page_params
%{page: 999, page_size: 50}
iex(2)> Actors.get_by_movie(movie, page_params)
%Scrivener.Page{
entries: [],
page_number: 999,
page_size: 50,
total_entries: 2,
total_pages: 2
} You can also pass that config when calling |
Thanks @ricardoebbers, was having a hard time with this, |
Below is my implementation I have used order_by condition
The data on the first page is fine but when I paginate to other pages I get 1-2 rows every time from previous pages.
The text was updated successfully, but these errors were encountered: