This commit is contained in:
呱呱呱 2025-11-19 11:17:48 +08:00
parent 9827b7b72b
commit 5adabc67c8
1 changed files with 8 additions and 8 deletions

View File

@ -98,20 +98,20 @@ class Api::V1::Projects::CodeChecksController < Api::V1::BaseController
end
def query_generate_pdf
result = @client.query_generate_pdf(params[:async_job_id])
send_data(
result[:data],
filename: result[:filename],
type: result[:content_type],
disposition: "attachment"
)
@result = @client.query_generate_pdf(params[:async_job_id])
render :index
end
def download_pdf
allowed_query = %w[job_file]
query_params, _ = filter_params(allowed_query_keys: allowed_query)
@result = @client.download_pdf(query_params)
render :index
send_data(
@result[:data],
filename: @result[:filename],
type: @result[:content_type],
disposition: "attachment"
)
end
private