From 7e37882cf7c8a12f13c9525fe70e286d2101af46 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Mon, 22 Jul 2024 17:19:31 -0400 Subject: Fix order of args for favorite/2 --- lib/pleroma/web/common_api.ex | 4 ++-- lib/pleroma/web/mastodon_api/controllers/status_controller.ex | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3