From 41493bd6428d42e1be4ba7294334310cb74c3e1e Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 30 Jan 2024 14:13:23 -0500 Subject: [PATCH] Revert "Pleroma.Web.MastodonAPI.DomainBlockController: dialyzer errors" This reverts commit 378edeaf159c0ff98780ad1b41f513992f1af305. --- lib/pleroma/web/api_spec/operations/domain_block_operation.ex | 4 ++-- .../web/mastodon_api/controllers/domain_block_controller.ex | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pleroma/web/api_spec/operations/domain_block_operation.ex b/lib/pleroma/web/api_spec/operations/domain_block_operation.ex index dac3bc883..2340fd914 100644 --- a/lib/pleroma/web/api_spec/operations/domain_block_operation.ex +++ b/lib/pleroma/web/api_spec/operations/domain_block_operation.ex @@ -73,10 +73,10 @@ defmodule Pleroma.Web.ApiSpec.DomainBlockOperation do %Schema{ type: :object, properties: %{ - "domain" => %Schema{type: :string} + domain: %Schema{type: :string} } }, - required: true, + required: false, example: %{ "domain" => "facebook.com" } diff --git a/lib/pleroma/web/mastodon_api/controllers/domain_block_controller.ex b/lib/pleroma/web/mastodon_api/controllers/domain_block_controller.ex index 33dfee3ca..b2e347ed9 100644 --- a/lib/pleroma/web/mastodon_api/controllers/domain_block_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/domain_block_controller.ex @@ -27,7 +27,7 @@ defmodule Pleroma.Web.MastodonAPI.DomainBlockController do end @doc "POST /api/v1/domain_blocks" - def create(%{assigns: %{user: blocker}, body_params: %{"domain" => domain}} = conn, _params) do + def create(%{assigns: %{user: blocker}, body_params: %{domain: domain}} = conn, _params) do User.block_domain(blocker, domain) json(conn, %{}) end @@ -38,7 +38,7 @@ defmodule Pleroma.Web.MastodonAPI.DomainBlockController do end @doc "DELETE /api/v1/domain_blocks" - def delete(%{assigns: %{user: blocker}, body_params: %{"domain" => domain}} = conn, _params) do + def delete(%{assigns: %{user: blocker}, body_params: %{domain: domain}} = conn, _params) do User.unblock_domain(blocker, domain) json(conn, %{}) end