Chatwoot/app/controllers/api/v1/accounts/conversations/direct_uploads_controller.rb
2022-03-16 13:54:18 +05:30

17 lines
433 B
Ruby

class Api::V1::Accounts::Conversations::DirectUploadsController < ActiveStorage::DirectUploadsController
include EnsureCurrentAccountHelper
before_action :current_account
before_action :conversation
def create
return if @conversation.nil? || @current_account.nil?
super
end
private
def conversation
@conversation ||= Current.account.conversations.find_by(display_id: params[:conversation_id])
end
end