1c084b74010cb28faa12fd126017dfd59347afba
[akkoma] / lib / pleroma / web / mastodon_api / controllers / report_controller.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.MastodonAPI.ReportController do
6 use Pleroma.Web, :controller
7
8 action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
9
10 @doc "POST /api/v1/reports"
11 def create(%{assigns: %{user: user}} = conn, params) do
12 with {:ok, activity} <- Pleroma.Web.CommonAPI.report(user, params) do
13 render(conn, "show.json", activity: activity)
14 end
15 end
16 end