Fix report PDF generation job params [SCI-5708]

This commit is contained in:
Oleksii Kriuchykhin 2021-05-07 17:00:34 +02:00
parent 7bc6abd9bb
commit e4d852b9f5

View file

@ -191,7 +191,7 @@ class ReportsController < ApplicationController
format.json do format.json do
@report.update!(pdf_file_processing: true) @report.update!(pdf_file_processing: true)
log_activity(:generate_pdf_report) log_activity(:generate_pdf_report)
Reports::PdfJob.perform_later(@report, current_user) Reports::PdfJob.perform_later(@report.id, current_user)
render json: { render json: {
message: I18n.t('projects.reports.index.generation.accepted_message') message: I18n.t('projects.reports.index.generation.accepted_message')
} }
@ -555,6 +555,6 @@ class ReportsController < ApplicationController
def generate_pdf_report def generate_pdf_report
log_activity(:generate_pdf_report) log_activity(:generate_pdf_report)
Reports::PdfJob.perform_later(@report, current_user) if @report.persisted? Reports::PdfJob.perform_later(@report.id, current_user) if @report.persisted?
end end
end end