Chore: Code Cleanup in API controllers (#932)

* Chore: Code Cleanup in API controllers

* Remove unnecessary scoping for accounts controller
This commit is contained in:
Sojan Jose
2020-06-07 13:58:05 +05:30
committed by GitHub
parent 3d84568a37
commit 051871a3cd
35 changed files with 176 additions and 182 deletions

View File

@@ -1,5 +1,4 @@
class Api::V1::Accounts::Channels::TwilioChannelsController < Api::BaseController
before_action :current_account
class Api::V1::Accounts::Channels::TwilioChannelsController < Api::V1::Accounts::BaseController
before_action :authorize_request
def create
@@ -38,13 +37,13 @@ class Api::V1::Accounts::Channels::TwilioChannelsController < Api::BaseControlle
end
def build_inbox
@twilio_channel = current_account.twilio_sms.create!(
@twilio_channel = Current.account.twilio_sms.create!(
account_sid: permitted_params[:account_sid],
auth_token: permitted_params[:auth_token],
phone_number: phone_number,
medium: medium
)
@inbox = current_account.inboxes.create(
@inbox = Current.account.inboxes.create(
name: permitted_params[:name],
channel: @twilio_channel
)