Merge branch 'develop' into openapi/reports
authorEgor Kislitsyn <egor@kislitsyn.com>
Thu, 30 Apr 2020 09:51:27 +0000 (13:51 +0400)
committerEgor Kislitsyn <egor@kislitsyn.com>
Thu, 30 Apr 2020 09:51:27 +0000 (13:51 +0400)
1  2 
lib/pleroma/web/mastodon_api/controllers/report_controller.ex

index 85bd521068c0723a77957368a9ed95c3c05e335a,9fbaa7bd1681487cf691fc63919bf3b84377a427..f65c5c62be4233febffc1298da6de622e83d3b04
@@@ -9,14 -9,10 +9,13 @@@ defmodule Pleroma.Web.MastodonAPI.Repor
  
    action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
  
 +  plug(OpenApiSpex.Plug.CastAndValidate, render_error: Pleroma.Web.ApiSpec.RenderError)
    plug(OAuthScopesPlug, %{scopes: ["write:reports"]} when action == :create)
-   plug(Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug)
  
 +  defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.ReportOperation
 +
    @doc "POST /api/v1/reports"
 -  def create(%{assigns: %{user: user}} = conn, params) do
 +  def create(%{assigns: %{user: user}, body_params: params} = conn, _) do
      with {:ok, activity} <- Pleroma.Web.CommonAPI.report(user, params) do
        render(conn, "show.json", activity: activity)
      end