another view for account in admin-fe status_show

This commit is contained in:
Alexander Strizhakov 2020-05-18 10:09:21 +03:00
parent c8803965af
commit 8f08384d80
No known key found for this signature in database
GPG Key ID: 022896A53AEF1381
2 changed files with 9 additions and 1 deletions

View File

@ -42,7 +42,7 @@ def index(%{assigns: %{user: _admin}} = conn, params) do
def show(conn, %{id: id}) do def show(conn, %{id: id}) do
with %Activity{} = activity <- Activity.get_by_id(id) do with %Activity{} = activity <- Activity.get_by_id(id) do
conn conn
|> put_view(MastodonAPI.StatusView) |> put_view(Pleroma.Web.AdminAPI.StatusView)
|> render("show.json", %{activity: activity}) |> render("show.json", %{activity: activity})
else else
nil -> {:error, :not_found} nil -> {:error, :not_found}

View File

@ -42,6 +42,14 @@ test "shows activity", %{conn: conn} do
|> json_response_and_validate_schema(200) |> json_response_and_validate_schema(200)
assert response["id"] == activity.id assert response["id"] == activity.id
account = response["account"]
actor = User.get_by_ap_id(activity.actor)
assert account["id"] == actor.id
assert account["nickname"] == actor.nickname
assert account["deactivated"] == actor.deactivated
assert account["confirmation_pending"] == actor.confirmation_pending
end end
end end