mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
fix: Feature flags are not be stored on account creation (#10387)
when creating an account via the platform API the feature flags do not get stored Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
@@ -4,6 +4,7 @@ class Platform::Api::V1::AccountsController < PlatformController
|
||||
def create
|
||||
@resource = Account.create!(account_params)
|
||||
update_resource_features
|
||||
@resource.save!
|
||||
@platform_app.platform_app_permissibles.find_or_create_by(permissible: @resource)
|
||||
end
|
||||
|
||||
|
||||
@@ -60,11 +60,10 @@ RSpec.describe 'Platform Accounts API', type: :request do
|
||||
} }, headers: { api_access_token: platform_app.access_token.token }, as: :json
|
||||
|
||||
json_response = response.parsed_body
|
||||
created_account = Account.find(json_response['id'])
|
||||
expect(created_account.enabled_features.keys).to match_array(%w[inbox_management ip_lookup help_center])
|
||||
expect(json_response['name']).to include('Test Account')
|
||||
expect(json_response['features']['inbox_management']).to be(true)
|
||||
expect(json_response['features']['ip_lookup']).to be(true)
|
||||
expect(json_response['features']['help_center']).to be(true)
|
||||
expect(json_response['features']['disable_branding']).to be_nil
|
||||
expect(json_response['features'].keys).to match_array(%w[inbox_management ip_lookup help_center])
|
||||
end
|
||||
|
||||
it 'creates an account with limits settings' do
|
||||
|
||||
Reference in New Issue
Block a user