Reduce file attributes in JSON for submission#show

This commit is contained in:
Sebastian Serth
2023-12-22 00:37:30 +01:00
committed by Sebastian Serth
parent 8c41aa5a73
commit 65212c4b4b
2 changed files with 9 additions and 9 deletions

View File

@ -1,6 +1,9 @@
# frozen_string_literal: true
json.extract! @submission, :id, :files
json.id @submission.id
json.files @submission.files do |file|
json.extract! file, :id, :file_id
end
json.download_url download_submission_path(@submission, format: :json)
json.score_url score_submission_path(@submission, format: :json)
json.download_file_url download_file_submission_path(@submission, 'a.', format: :json).gsub(/a\.\.json$/,