Fix order of args for update/2

This commit is contained in:
Mark Felder 2024-07-22 17:49:30 -04:00
commit f602813d31
14 changed files with 25 additions and 25 deletions

View file

@ -461,8 +461,8 @@ defmodule Pleroma.Web.CommonAPI do
end
end
@spec update(User.t(), Activity.t(), map()) :: {:ok, Activity.t()} | {:error, any()}
def update(user, orig_activity, changes) do
@spec update(Activity.t(), User.t(), map()) :: {:ok, Activity.t()} | {:error, any()}
def update(orig_activity, %User{} = user, changes) do
with orig_object <- Object.normalize(orig_activity),
{:ok, new_object} <- make_update_data(user, orig_object, changes),
{:ok, update_data, _} <- Builder.update(user, new_object),

View file

@ -276,7 +276,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
actor <- Activity.user_actor(activity),
{_, true} <- {:own_status, actor.id == user.id},
changes <- body_params |> put_application(conn),
{_, {:ok, _update_activity}} <- {:pipeline, CommonAPI.update(user, activity, changes)},
{_, {:ok, _update_activity}} <- {:pipeline, CommonAPI.update(activity, user, changes)},
{_, %Activity{}} = {_, activity} <- {:refetched, Activity.get_by_id_with_object(id)} do
try_render(conn, "show.json",
activity: activity,