ap/collection: don't advertise next page if no more entries
And off-by-one error caused the last page to always advertise one more page eventhough the absence of further items is known
This commit is contained in:
parent
5987dd43d4
commit
89678f92d9
1 changed files with 1 additions and 1 deletions
|
|
@ -290,7 +290,7 @@ def collection(collection, iri, page, show_items \\ true, total \\ nil) do
|
|||
"orderedItems" => if(show_items, do: items, else: [])
|
||||
}
|
||||
|
||||
if offset < total do
|
||||
if offset + 10 < total do
|
||||
Map.put(map, "next", "#{iri}?page=#{page + 1}")
|
||||
else
|
||||
map
|
||||
|
|
|
|||
Loading…
Reference in a new issue