diff --git a/lib/pleroma/web/api_spec/operations/chat_operation.ex b/lib/pleroma/web/api_spec/operations/chat_operation.ex index cf6a055fc..cee39f9d3 100644 --- a/lib/pleroma/web/api_spec/operations/chat_operation.ex +++ b/lib/pleroma/web/api_spec/operations/chat_operation.ex @@ -368,9 +368,9 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation 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 6158af60e..dc0f2cfe3 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 @@ defmodule Pleroma.Web.PleromaAPI.ChatController do 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),