diff options
author | rinpatch <rinpatch@sdf.org> | 2019-06-02 23:24:48 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-06-02 23:24:48 +0300 |
commit | e3c460353dacb796a867a0a3afa3632746d57aa2 (patch) | |
tree | 8c47ef6af2e1145a08aa60951e3f054bff062c8f /lib | |
parent | 67bcc3ccc433bd5c7b59f5bf1a45db93da93d093 (diff) | |
download | pleroma-e3c460353dacb796a867a0a3afa3632746d57aa2.tar.gz |
Refresh the object in CommonAPI.vote instead of MastoAPI controller
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/common_api/common_api.ex | 1 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index f54f8a7b9..a12ee011b 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -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"} diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index 8da31161f..bab6d693d 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -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}) |