From b709fc4dfe2708a95c3fd3179f4de20051b138d7 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 30 Jan 2024 14:15:05 -0500 Subject: [PATCH] Revert "Pleroma.Web.PleromaAPI.ChatController: Dialyzer error" This reverts commit 8d64eedbecec99d1ae19d300891a9c4cd3dbdf9d. --- lib/pleroma/web/api_spec/operations/chat_operation.ex | 4 ++-- lib/pleroma/web/pleroma_api/controllers/chat_controller.ex | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/api_spec/operations/chat_operation.ex b/lib/pleroma/web/api_spec/operations/chat_operation.ex index d3b033f0b..f56e57a41 100644 --- a/lib/pleroma/web/api_spec/operations/chat_operation.ex +++ b/lib/pleroma/web/api_spec/operations/chat_operation.ex @@ -378,9 +378,9 @@ def mark_as_read do title: "MarkAsReadRequest", description: "POST body for marking a number of chat messages as read", type: :object, - required: ["last_read_id"], + required: [:last_read_id], properties: %{ - "last_read_id" => %Schema{ + last_read_id: %Schema{ type: :string, description: "The content of your message." } diff --git a/lib/pleroma/web/pleroma_api/controllers/chat_controller.ex b/lib/pleroma/web/pleroma_api/controllers/chat_controller.ex index dc0f2cfe3..6158af60e 100644 --- a/lib/pleroma/web/pleroma_api/controllers/chat_controller.ex +++ b/lib/pleroma/web/pleroma_api/controllers/chat_controller.ex @@ -120,7 +120,7 @@ def mark_message_as_read( end def mark_as_read( - %{body_params: %{"last_read_id" => last_read_id}, assigns: %{user: user}} = conn, + %{body_params: %{last_read_id: last_read_id}, assigns: %{user: user}} = conn, %{id: id} ) do with {:ok, chat} <- Chat.get_by_user_and_id(user, id),