Do not add the "next" key to likes.json if there is no more items

This commit is contained in:
Sergey Suprunenko 2019-08-04 17:13:06 +00:00 committed by kaniini
commit e8ad116c2a
3 changed files with 55 additions and 6 deletions

View file

@ -66,8 +66,10 @@ defmodule Pleroma.Web.ActivityPub.ObjectView do
"orderedItems" => items
}
if offset < total do
if offset + length(items) < total do
Map.put(map, "next", "#{iri}?page=#{page + 1}")
else
map
end
end
end