fix(app-store): simplify inbox creation controller

This commit is contained in:
Muhsin
2026-06-03 15:16:06 +04:00
parent 14e9e9f63d
commit 2fadbf81bc
2 changed files with 0 additions and 22 deletions
@@ -31,8 +31,6 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
end
def create
return render_app_store_feature_disabled if app_store_channel_requested? && !Current.account.feature_enabled?(:channel_app_store)
ActiveRecord::Base.transaction do
channel = create_channel
@inbox = Current.account.inboxes.build(
@@ -102,14 +100,6 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
%w[web_widget api email line telegram whatsapp sms app_store]
end
def app_store_channel_requested?
permitted_params.dig(:channel, :type) == 'app_store'
end
def render_app_store_feature_disabled
render json: { message: 'App Store Reviews channel is not enabled for this account' }, status: :forbidden
end
def update_inbox_working_hours
@inbox.update_working_hours(params.permit(working_hours: Inbox::OFFISABLE_ATTRS)[:working_hours]) if params[:working_hours]
end