Admin API: Allow changing the state of multiple reports at once

This commit is contained in:
Maxim Filippov 2019-10-04 19:00:58 +03:00
commit 8dcc2f9f5e
7 changed files with 142 additions and 27 deletions

View file

@ -346,6 +346,13 @@ defmodule Pleroma.Web.CommonAPI do
end
end
def update_report_state(activity_ids, state) when is_list(activity_ids) do
case Utils.update_report_state(activity_ids, state) do
:ok -> {:ok, activity_ids}
_ -> {:error, dgettext("errors", "Could not update state")}
end
end
def update_report_state(activity_id, state) do
with %Activity{} = activity <- Activity.get_by_id(activity_id) do
Utils.update_report_state(activity, state)