refactor(email): tighten inbox setup flow
This commit is contained in:
@@ -41,7 +41,7 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
|
||||
name: inbox_name(channel),
|
||||
channel: channel
|
||||
}.merge(
|
||||
permitted_params.except(:channel)
|
||||
permitted_params.except(:channel, :imap_fetch_interval)
|
||||
)
|
||||
)
|
||||
@inbox.save!
|
||||
@@ -192,7 +192,7 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
|
||||
def permitted_params(channel_attributes = [])
|
||||
# We will remove this line after fixing https://linear.app/chatwoot/issue/CW-1567/null-value-passed-as-null-string-to-backend
|
||||
params.each { |k, v| params[k] = params[k] == 'null' ? nil : v }
|
||||
params.permit(*inbox_attributes, channel: [:type, *channel_attributes])
|
||||
params.permit(:imap_fetch_interval, *inbox_attributes, channel: [:type, *channel_attributes])
|
||||
end
|
||||
|
||||
def channel_type_from_params
|
||||
|
||||
Reference in New Issue
Block a user