mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Provide totalItems field for featured collections
This commit is contained in:
parent
f34e22bba2
commit
4694853766
2 changed files with 3 additions and 2 deletions
|
@ -261,7 +261,8 @@ defmodule Pleroma.Web.ActivityPub.UserView do
|
||||||
%{
|
%{
|
||||||
"id" => featured_address,
|
"id" => featured_address,
|
||||||
"type" => "OrderedCollection",
|
"type" => "OrderedCollection",
|
||||||
"orderedItems" => objects
|
"orderedItems" => objects,
|
||||||
|
"totalItems" => length(objects)
|
||||||
}
|
}
|
||||||
|> Map.merge(Utils.make_json_ld_header())
|
|> Map.merge(Utils.make_json_ld_header())
|
||||||
end
|
end
|
||||||
|
|
|
@ -1966,7 +1966,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
|
||||||
%{nickname: nickname, featured_address: featured_address, pinned_objects: pinned_objects} =
|
%{nickname: nickname, featured_address: featured_address, pinned_objects: pinned_objects} =
|
||||||
refresh_record(user)
|
refresh_record(user)
|
||||||
|
|
||||||
%{"id" => ^featured_address, "orderedItems" => items} =
|
%{"id" => ^featured_address, "orderedItems" => items, "totalItems" => 2} =
|
||||||
conn
|
conn
|
||||||
|> get("/users/#{nickname}/collections/featured")
|
|> get("/users/#{nickname}/collections/featured")
|
||||||
|> json_response(200)
|
|> json_response(200)
|
||||||
|
|
Loading…
Reference in a new issue