DEV: Switch to new ExportUserArchive job

We now use the newly created job class from the previous commit.
This commit is contained in:
Kane York
2020-08-27 15:54:25 -07:00
committed by Kane York
parent a8560d741f
commit 7bf199b0c4
5 changed files with 24 additions and 123 deletions

View File

@ -6,7 +6,12 @@ class ExportCsvController < ApplicationController
def export_entity
guardian.ensure_can_export_entity!(export_params[:entity])
Jobs.enqueue(:export_csv_file, entity: export_params[:entity], user_id: current_user.id, args: export_params[:args])
if export_params[:entity] == 'user_archive'
Jobs.enqueue(:export_user_archive, user_id: current_user.id, args: export_params[:args])
else
Jobs.enqueue(:export_csv_file, entity: export_params[:entity], user_id: current_user.id, args: export_params[:args])
end
StaffActionLogger.new(current_user).log_entity_export(export_params[:entity])
render json: success_json
rescue Discourse::InvalidAccess