Chatwoot/app/controllers/api/v1/conversations/messages_controller.rb
Pranav Raj S 2a4fb7b056
Bug: Fix conversation not loading from the links in email (#602)
Bug: Load conversation from links
2020-03-08 22:08:25 +05:30

18 lines
426 B
Ruby

class Api::V1::Conversations::MessagesController < Api::BaseController
before_action :set_conversation, only: [:index, :create]
def index
@messages = message_finder.perform
end
def create
mb = Messages::Outgoing::NormalBuilder.new(current_user, @conversation, params)
@message = mb.perform
end
private
def message_finder
@message_finder ||= MessageFinder.new(@conversation, params)
end
end