Merge branch 'fix-collection-next' into 'master'
Fix collection next attribute and add prev attribute Closes #546 See merge request framasoft/mobilizon!785
This commit is contained in:
commit
7e31d5354b
@ -153,8 +153,18 @@ defmodule Mobilizon.Web.ActivityPub.ActorView do
|
|||||||
"orderedItems" => Enum.map(collection, &item/1)
|
"orderedItems" => Enum.map(collection, &item/1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
map =
|
||||||
if offset < total do
|
if offset < total do
|
||||||
Map.put(map, "next", Actor.build_url(preferred_username, endpoint, page: page + 1))
|
Map.put(map, "next", Actor.build_url(preferred_username, endpoint, page: page + 1))
|
||||||
|
else
|
||||||
|
map
|
||||||
|
end
|
||||||
|
|
||||||
|
map =
|
||||||
|
if offset > total do
|
||||||
|
Map.put(map, "prev", Actor.build_url(preferred_username, endpoint, page: page - 1))
|
||||||
|
else
|
||||||
|
map
|
||||||
end
|
end
|
||||||
|
|
||||||
map
|
map
|
||||||
|
Loading…
Reference in New Issue
Block a user