Add POST /api/v1/conversations/:id/unread (#25509)
This commit is contained in:
parent
c9cd634184
commit
1d622c8033
@ -19,6 +19,11 @@ class Api::V1::ConversationsController < Api::BaseController
|
|||||||
render json: @conversation, serializer: REST::ConversationSerializer
|
render json: @conversation, serializer: REST::ConversationSerializer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def unread
|
||||||
|
@conversation.update!(unread: true)
|
||||||
|
render json: @conversation, serializer: REST::ConversationSerializer
|
||||||
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@conversation.destroy!
|
@conversation.destroy!
|
||||||
render_empty
|
render_empty
|
||||||
|
@ -81,6 +81,7 @@ namespace :api, format: false do
|
|||||||
resources :conversations, only: [:index, :destroy] do
|
resources :conversations, only: [:index, :destroy] do
|
||||||
member do
|
member do
|
||||||
post :read
|
post :read
|
||||||
|
post :unread
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user