fix: Update enabled_features logic to fix superadmin edit action (#5959)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
class Platform::Api::V1::AccountsController < PlatformController
|
||||
def create
|
||||
@resource = Account.new(account_params)
|
||||
@resource = Account.create!(account_params)
|
||||
update_resource_features
|
||||
@resource.save!
|
||||
@platform_app.platform_app_permissibles.find_or_create_by(permissible: @resource)
|
||||
end
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ module Featurable
|
||||
include FlagShihTzu
|
||||
has_flags FEATURES.merge(column: 'feature_flags').merge(QUERY_MODE)
|
||||
|
||||
after_initialize :enable_default_features
|
||||
before_create :enable_default_features
|
||||
end
|
||||
|
||||
def enable_features(*names)
|
||||
|
||||
@@ -3,7 +3,7 @@ json.name resource.name
|
||||
json.locale resource.locale
|
||||
json.domain resource.domain
|
||||
json.support_email resource.support_email
|
||||
json.enabled_features resource.enabled_features
|
||||
json.features resource.enabled_features
|
||||
json.custom_attributes resource.custom_attributes
|
||||
json.limits resource.limits
|
||||
json.status resource.status
|
||||
|
||||
Reference in New Issue
Block a user