Merge pull request #5777 from wandji20/wb-SCI-8851

Fix issue archiving task result tables and when downloading archived result table
This commit is contained in:
artoscinote 2023-07-18 08:18:11 +02:00 committed by GitHub
commit e79c73f8c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -63,7 +63,7 @@ class ResultTablesController < ApplicationController
@result.table.last_modified_by = current_user
@result.table.team = current_team
@result.assign_attributes(update_params)
@result.table.metadata = JSON.parse(update_params[:table_attributes][:metadata])
@result.table.metadata = JSON.parse(update_params[:table_attributes][:metadata]) if update_params[:table_attributes]
flash_success = t("result_tables.update.success_flash",
module: @my_module.name)
if @result.archived_changed?(from: false, to: true)
@ -108,7 +108,7 @@ class ResultTablesController < ApplicationController
def download
_ = JSON.parse @result_table.table.contents
@table_data = _["data"] || []
data = render_to_string partial: 'download.txt.erb'
data = render_to_string partial: 'download'
send_data data, filename: @result_table.result.name + '.txt',
type: 'plain/text'
end