From da5e0fca4fee099b65a76f27013032776600ac40 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 30 Jan 2024 14:14:07 -0500 Subject: [PATCH] Revert "Pleroma.Web.AdminAPI.ReportController: dialyzer errors" This reverts commit bfe626d5787ae546e2a96b8c4c621c09fea1332a. --- lib/pleroma/web/admin_api/controllers/report_controller.ex | 4 ++-- .../web/api_spec/operations/admin/report_operation.ex | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pleroma/web/admin_api/controllers/report_controller.ex b/lib/pleroma/web/admin_api/controllers/report_controller.ex index f667e7003..15cbbcc3e 100644 --- a/lib/pleroma/web/admin_api/controllers/report_controller.ex +++ b/lib/pleroma/web/admin_api/controllers/report_controller.ex @@ -45,7 +45,7 @@ defmodule Pleroma.Web.AdminAPI.ReportController do end end - def update(%{assigns: %{user: admin}, body_params: %{"reports" => reports}} = conn, _) do + def update(%{assigns: %{user: admin}, body_params: %{reports: reports}} = conn, _) do result = Enum.map(reports, fn report -> case CommonAPI.update_report_state(report.id, report.state) do @@ -73,7 +73,7 @@ defmodule Pleroma.Web.AdminAPI.ReportController do end end - def notes_create(%{assigns: %{user: user}, body_params: %{"content" => content}} = conn, %{ + def notes_create(%{assigns: %{user: user}, body_params: %{content: content}} = conn, %{ id: report_id }) do with {:ok, _} <- ReportNote.create(user.id, report_id, content), diff --git a/lib/pleroma/web/api_spec/operations/admin/report_operation.ex b/lib/pleroma/web/api_spec/operations/admin/report_operation.ex index 29b08d93c..fbb6896a9 100644 --- a/lib/pleroma/web/api_spec/operations/admin/report_operation.ex +++ b/lib/pleroma/web/api_spec/operations/admin/report_operation.ex @@ -107,7 +107,7 @@ defmodule Pleroma.Web.ApiSpec.Admin.ReportOperation do request_body("Parameters", %Schema{ type: :object, properties: %{ - "content" => %Schema{type: :string, description: "The message"} + content: %Schema{type: :string, description: "The message"} } }), security: [%{"oAuth" => ["admin:write:reports"]}], @@ -199,9 +199,9 @@ defmodule Pleroma.Web.ApiSpec.Admin.ReportOperation do defp update_request do %Schema{ type: :object, - required: ["reports"], + required: [:reports], properties: %{ - "reports" => %Schema{ + reports: %Schema{ type: :array, items: %Schema{ type: :object,