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

local
Claire 11 months ago committed by GitHub
parent c9cd634184
commit 1d622c8033
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      app/controllers/api/v1/conversations_controller.rb
  2. 1
      config/routes/api.rb

@ -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

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

Loading…
Cancel
Save