mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-28 00:25:25 +00:00
mastodon api: use Object.normalize() in a few missing spots
This commit is contained in:
parent
e9b718cea2
commit
5d4a71906a
|
@ -464,7 +464,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
||||||
end
|
end
|
||||||
|
|
||||||
def favourited_by(conn, %{"id" => id}) do
|
def favourited_by(conn, %{"id" => id}) do
|
||||||
with %Activity{data: %{"object" => %{"likes" => likes}}} <- Repo.get(Activity, id) do
|
with %Activity{data: %{"object" => object}} <- Repo.get(Activity, id),
|
||||||
|
%Object{data: %{"likes" => likes}} <- Object.normalize(object) do
|
||||||
q = from(u in User, where: u.ap_id in ^likes)
|
q = from(u in User, where: u.ap_id in ^likes)
|
||||||
users = Repo.all(q)
|
users = Repo.all(q)
|
||||||
render(conn, AccountView, "accounts.json", %{users: users, as: :user})
|
render(conn, AccountView, "accounts.json", %{users: users, as: :user})
|
||||||
|
@ -474,7 +475,8 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
||||||
end
|
end
|
||||||
|
|
||||||
def reblogged_by(conn, %{"id" => id}) do
|
def reblogged_by(conn, %{"id" => id}) do
|
||||||
with %Activity{data: %{"object" => %{"announcements" => announces}}} <- Repo.get(Activity, id) do
|
with %Activity{data: %{"object" => object}} <- Repo.get(Activity, id),
|
||||||
|
%Object{data: %{"announcements" => announces}} <- Object.normalize(object) do
|
||||||
q = from(u in User, where: u.ap_id in ^announces)
|
q = from(u in User, where: u.ap_id in ^announces)
|
||||||
users = Repo.all(q)
|
users = Repo.all(q)
|
||||||
render(conn, AccountView, "accounts.json", %{users: users, as: :user})
|
render(conn, AccountView, "accounts.json", %{users: users, as: :user})
|
||||||
|
|
Loading…
Reference in a new issue