Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

22 lignes
779B

  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.MastodonAPI.ReportController do
  5. use Pleroma.Web, :controller
  6. action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
  7. plug(Pleroma.Web.ApiSpec.CastAndValidate)
  8. plug(Pleroma.Web.Plugs.OAuthScopesPlug, %{scopes: ["write:reports"]} when action == :create)
  9. defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.ReportOperation
  10. @doc "POST /api/v1/reports"
  11. def create(%{assigns: %{user: user}, body_params: params} = conn, _) 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