summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-07-22 17:19:31 -0400
committerMark Felder <feld@feld.me>2024-07-22 18:25:37 -0400
commit7e37882cf7c8a12f13c9525fe70e286d2101af46 (patch)
tree1120eb503d57eb031f59136c8721cd9fb48ba4b8 /lib
parentb1d33483310df3b5b5a4570ffc33f55b2eeca9b6 (diff)
downloadpleroma-7e37882cf7c8a12f13c9525fe70e286d2101af46.tar.gz
pleroma-7e37882cf7c8a12f13c9525fe70e286d2101af46.zip
Fix order of args for favorite/2
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