Feature: Send attachments to widget user (#621)

This commit is contained in:
Nithin David Thomas
2020-03-22 15:54:36 +05:30
committed by GitHub
parent fe70843fae
commit f7e5f1fabf
16 changed files with 317 additions and 92 deletions

View File

@@ -11,6 +11,10 @@ class Api::V1::Widget::MessagesController < Api::V1::Widget::BaseController
def create
@message = conversation.messages.new(message_params)
@message.save!
if params[:message][:attachment].present?
@message.attachment = Attachment.new(account_id: @message.account_id)
@message.attachment.file.attach(params[:message][:attachment][:file])
end
render json: @message
end