Fix collection next attribute and add prev attribute
Closes #546 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
24461be703
commit
5d8ad897fd
|
@ -153,9 +153,19 @@ defmodule Mobilizon.Web.ActivityPub.ActorView do
|
||||||
"orderedItems" => Enum.map(collection, &item/1)
|
"orderedItems" => Enum.map(collection, &item/1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if offset < total do
|
map =
|
||||||
Map.put(map, "next", Actor.build_url(preferred_username, endpoint, page: page + 1))
|
if offset < total do
|
||||||
end
|
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
|
||||||
|
|
||||||
map
|
map
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue