diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2021-02-15 21:48:13 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2021-02-15 21:48:13 +0400 |
commit | cf6d3db58f20de5224fa77dbf902e78a653ced96 (patch) | |
tree | f944d6f0d9e9e012e560a8e99468421d40a101e0 /lib/pleroma/web/api_spec | |
parent | 8910303f71b6fa0a1fd79531ec983e1a9c5dc5ac (diff) | |
download | pleroma-cf6d3db58f20de5224fa77dbf902e78a653ced96.tar.gz |
Add API endpoint to remove a conversation
Diffstat (limited to 'lib/pleroma/web/api_spec')
-rw-r--r-- | lib/pleroma/web/api_spec/operations/conversation_operation.ex | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/lib/pleroma/web/api_spec/operations/conversation_operation.ex b/lib/pleroma/web/api_spec/operations/conversation_operation.ex index 367f4125a..17ed1af5e 100644 --- a/lib/pleroma/web/api_spec/operations/conversation_operation.ex +++ b/lib/pleroma/web/api_spec/operations/conversation_operation.ex @@ -46,16 +46,31 @@ defmodule Pleroma.Web.ApiSpec.ConversationOperation do tags: ["Conversations"], summary: "Mark conversation as read", operationId: "ConversationController.mark_as_read", - parameters: [ - Operation.parameter(:id, :path, :string, "Conversation ID", - example: "123", - required: true - ) - ], + parameters: [id_param()], security: [%{"oAuth" => ["write:conversations"]}], responses: %{ 200 => Operation.response("Conversation", "application/json", Conversation) } } end + + def delete_operation do + %Operation{ + tags: ["Conversations"], + summary: "Remove conversation", + operationId: "ConversationController.delete", + parameters: [id_param()], + security: [%{"oAuth" => ["write:conversations"]}], + responses: %{ + 200 => empty_object_response() + } + } + end + + def id_param do + Operation.parameter(:id, :path, :string, "Conversation ID", + example: "123", + required: true + ) + end end |