FIX: Return next bookmarks page only if it exists (#18139)

It used to return the next URL anyway which lead to an additional
request. On the frontend, if the result set was empty, it kept retrying
until at least one result was returned. This bug is fixed in this commit
too.
This commit is contained in:
Bianca Nenciu
2022-09-01 13:04:00 +03:00
committed by GitHub
parent 07aa324f61
commit 5092c9804c
5 changed files with 11 additions and 4 deletions

View File

@@ -15,6 +15,6 @@ class UserBookmarkListSerializer < ApplicationSerializer
end
def include_more_bookmarks_url?
@include_more_bookmarks_url ||= object.bookmarks.size == object.per_page
@include_more_bookmarks_url ||= object.has_more
end
end