PleromaAPI: Add unreacting.
This commit is contained in:
parent
391c736292
commit
4cb603e1df
3 changed files with 19 additions and 1 deletions
|
|
@ -41,7 +41,19 @@ defmodule Pleroma.Web.PleromaAPI.PleromaAPIController do
|
|||
|
||||
def react_with_emoji(%{assigns: %{user: user}} = conn, %{"id" => activity_id, "emoji" => emoji}) do
|
||||
with {:ok, _activity, _object} <- CommonAPI.react_with_emoji(activity_id, user, emoji),
|
||||
activity = Activity.get_by_id(activity_id) do
|
||||
activity <- Activity.get_by_id(activity_id) do
|
||||
conn
|
||||
|> put_view(StatusView)
|
||||
|> render("show.json", %{activity: activity, for: user, as: :activity})
|
||||
end
|
||||
end
|
||||
|
||||
def unreact_with_emoji(%{assigns: %{user: user}} = conn, %{
|
||||
"id" => activity_id,
|
||||
"emoji" => emoji
|
||||
}) do
|
||||
with {:ok, _activity, _object} <- CommonAPI.unreact_with_emoji(activity_id, user, emoji),
|
||||
activity <- Activity.get_by_id(activity_id) do
|
||||
conn
|
||||
|> put_view(StatusView)
|
||||
|> render("show.json", %{activity: activity, for: user, as: :activity})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue