ChatController: Add last_read_id option to mark_as_read.

This commit is contained in:
lain 2020-06-07 15:38:33 +02:00
commit 801e668a97
4 changed files with 58 additions and 7 deletions

View file

@ -23,6 +23,7 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
summary: "Mark all messages in the chat as read",
operationId: "ChatController.mark_as_read",
parameters: [Operation.parameter(:id, :path, :string, "The ID of the Chat")],
requestBody: request_body("Parameters", mark_as_read()),
responses: %{
200 =>
Operation.response(
@ -333,4 +334,21 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
}
}
end
def mark_as_read do
%Schema{
title: "MarkAsReadRequest",
description: "POST body for marking a number of chat messages as read",
type: :object,
properties: %{
last_read_id: %Schema{
type: :string,
description: "The content of your message. Optional."
}
},
example: %{
"last_read_id" => "abcdef12456"
}
}
end
end