2022-07-01 21:15:00 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Settings::ExportController < ApplicationController
|
|
|
|
before_action :authenticate_user!
|
|
|
|
|
|
|
|
def index
|
2022-07-02 05:43:53 -07:00
|
|
|
flash[:info] = t(".info") if current_user.export_processing
|
2022-07-01 21:15:00 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
if current_user.can_export?
|
|
|
|
ExportWorker.perform_async(current_user.id)
|
|
|
|
flash[:success] = t(".success")
|
|
|
|
else
|
|
|
|
flash[:error] = t(".error")
|
|
|
|
end
|
|
|
|
|
|
|
|
redirect_to settings_export_path
|
|
|
|
end
|
|
|
|
end
|