2018-12-05 19:51:30 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Issues
|
2020-11-05 19:09:14 -05:00
|
|
|
class ImportCsvService < Issuable::ImportCsv::BaseService
|
2018-12-05 19:51:30 -05:00
|
|
|
def execute
|
2020-10-20 11:08:57 -04:00
|
|
|
record_import_attempt
|
2018-12-05 19:51:30 -05:00
|
|
|
|
2020-11-05 19:09:14 -05:00
|
|
|
super
|
2018-12-05 19:51:30 -05:00
|
|
|
end
|
|
|
|
|
2020-11-05 19:09:14 -05:00
|
|
|
def email_results_to_user
|
|
|
|
Notify.import_issues_csv_email(@user.id, @project.id, @results).deliver_later
|
2020-10-20 11:08:57 -04:00
|
|
|
end
|
|
|
|
|
2020-11-05 19:09:14 -05:00
|
|
|
private
|
2018-12-05 19:51:30 -05:00
|
|
|
|
2020-11-05 19:09:14 -05:00
|
|
|
def create_issuable_class
|
|
|
|
Issues::CreateService
|
2018-12-05 19:51:30 -05:00
|
|
|
end
|
|
|
|
|
2020-11-05 19:09:14 -05:00
|
|
|
def record_import_attempt
|
|
|
|
Issues::CsvImport.create!(user: @user, project: @project)
|
2018-12-05 19:51:30 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|