2020-06-07 08:28:05 +00:00
|
|
|
class Api::V1::Accounts::Conversations::MessagesController < Api::V1::Accounts::Conversations::BaseController
|
2020-03-08 16:38:25 +00:00
|
|
|
def index
|
|
|
|
@messages = message_finder.perform
|
|
|
|
end
|
2019-08-14 09:48:44 +00:00
|
|
|
|
|
|
|
def create
|
2020-06-27 16:04:53 +00:00
|
|
|
user = current_user || @resource
|
|
|
|
mb = Messages::Outgoing::NormalBuilder.new(user, @conversation, params)
|
2019-08-14 09:48:44 +00:00
|
|
|
@message = mb.perform
|
|
|
|
end
|
2020-03-08 16:38:25 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def message_finder
|
|
|
|
@message_finder ||= MessageFinder.new(@conversation, params)
|
|
|
|
end
|
2019-08-14 09:48:44 +00:00
|
|
|
end
|