Fix order of args for favorite/2

This commit is contained in:
Mark Felder 2024-07-22 17:19:31 -04:00
commit 7e37882cf7
27 changed files with 90 additions and 90 deletions

View file

@ -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

View file

@ -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