Class: Telephony::TransfersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Telephony::TransfersController
- Defined in:
- app/controllers/telephony/transfers_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/telephony/transfers_controller.rb', line 5 def create Conversation.find_with_lock params[:conversation_id] do |conversation| if conversation.transfer! params[:transfer_id], params[:transfer_type] == 'one_step' render json: {} else errors = ['Transfer failed. Please try again in a few seconds.'] + conversation.errors. render json: { errors: errors }, status: :unprocessable_entity end end end |