mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
651 B
30 lines
651 B
# frozen_string_literal: true
|
|
|
|
class AccountLogoController < ApplicationController
|
|
before_action :authorize_account_config
|
|
|
|
def create
|
|
file = params[:file]
|
|
|
|
if file.blank?
|
|
return redirect_to settings_personalization_path, alert: I18n.t('unable_to_save')
|
|
end
|
|
|
|
current_account.logo.attach(file)
|
|
|
|
redirect_to settings_personalization_path, notice: I18n.t('settings_have_been_saved')
|
|
end
|
|
|
|
def destroy
|
|
current_account.logo.purge
|
|
|
|
redirect_to settings_personalization_path, notice: I18n.t('settings_have_been_saved')
|
|
end
|
|
|
|
private
|
|
|
|
def authorize_account_config
|
|
authorize!(:create, AccountConfig)
|
|
end
|
|
end
|