Refresh the object in CommonAPI.vote instead of MastoAPI controller
This commit is contained in:
parent
67bcc3ccc4
commit
e3c460353d
@ -141,6 +141,7 @@ defmodule Pleroma.Web.CommonAPI do
|
||||
})
|
||||
end)
|
||||
|
||||
object = Object.get_cached_by_ap_id(object.data["id"])
|
||||
{:ok, answer_activities, object}
|
||||
else
|
||||
{:author, _} -> {:error, "Already voted"}
|
||||
|
@ -436,8 +436,6 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
||||
%Activity{} = activity <- Activity.get_create_by_object_ap_id(object.data["id"]),
|
||||
true <- Visibility.visible_for_user?(activity, user),
|
||||
{:ok, _activities, object} <- CommonAPI.vote(user, object, choices) do
|
||||
object = Object.get_cached_by_ap_id(object.data["id"])
|
||||
|
||||
conn
|
||||
|> put_view(StatusView)
|
||||
|> try_render("poll.json", %{object: object, for: user})
|
||||
|
Loading…
Reference in New Issue
Block a user