summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/common_api.ex4
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/status_controller.ex2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/common_api.ex b/lib/pleroma/web/common_api.ex
index 411acf8fb..f8a03680a 100644
--- a/lib/pleroma/web/common_api.ex
+++ b/lib/pleroma/web/common_api.ex
@@ -247,8 +247,8 @@ defmodule Pleroma.Web.CommonAPI do
end
end
- @spec favorite(User.t(), String.t()) :: {:ok, Activity.t()} | {:error, any()}
- def favorite(%User{} = user, id) do
+ @spec favorite(String.t(), User.t()) :: {:ok, Activity.t()} | {:error, any()}
+ def favorite(id, %User{} = user) do
case favorite_helper(user, id) do
{:ok, _} = res ->
res
diff --git a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
index 83e1bee54..80386dc45 100644
--- a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex
@@ -357,7 +357,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
conn,
_
) do
- with {:ok, _fav} <- CommonAPI.favorite(user, activity_id),
+ with {:ok, _fav} <- CommonAPI.favorite(activity_id, user),
%Activity{} = activity <- Activity.get_by_id(activity_id) do
try_render(conn, "show.json", activity: activity, for: user, as: :activity)
end