chore: Data needed to store onboarding flow

This commit is contained in:
Sojan
2024-02-14 19:55:45 +05:30
parent 11886a4e5e
commit f9900947dc
4 changed files with 7 additions and 2 deletions
@@ -49,6 +49,9 @@ class Api::V1::Accounts::AgentsController < Api::V1::Accounts::BaseController
Rails.logger.info "[Agent#bulk_create] ignoring email #{email}, errors: #{e.record.errors}"
end
end
# remove onboarding_step key in present in Current account custom attributes
Current.account.custom_attributes.delete('onboarding_step')
Current.account.save!
head :ok
end
@@ -43,7 +43,7 @@ class Api::V1::AccountsController < Api::BaseController
def update
@account.assign_attributes(account_params.slice(:name, :locale, :domain, :support_email, :auto_resolve_duration))
@account.custom_attributes.merge!(custom_attributes_params)
@account.custom_attributes['onboarding_step'] = 'invite_team' if custom_attributes_params[:onboarding_step].present?
@account.save!
end