Add POST /api/v1/conversations/:id/unread (#25509)

lolsob-rspec
Claire 2023-06-22 18:46:43 +02:00 committed by GitHub
parent acc8d8bf8e
commit 3406cb0427
2 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,11 @@ class Api::V1::ConversationsController < Api::BaseController
render json: @conversation, serializer: REST::ConversationSerializer
end
def unread
@conversation.update!(unread: true)
render json: @conversation, serializer: REST::ConversationSerializer
end
def destroy
@conversation.destroy!
render_empty

View File

@ -81,6 +81,7 @@ namespace :api, format: false do
resources :conversations, only: [:index, :destroy] do
member do
post :read
post :unread
end
end