diff --git a/app/controllers/api/v0/competitions_controller.rb b/app/controllers/api/v0/competitions_controller.rb index 9bbba881f6..c1757c07d8 100644 --- a/app/controllers/api/v0/competitions_controller.rb +++ b/app/controllers/api/v0/competitions_controller.rb @@ -29,7 +29,8 @@ def competition_index serial_includes = {} serial_includes["delegates"] = { only: ["id", "name"], methods: [], include: ["avatar"] } if admin_mode - serial_methods |= ["announced_at", "results_submitted_at", "report_posted_at"] if admin_mode + serial_includes["delegate_report"] = { only: ["posted_by_user_id"] } if admin_mode + serial_methods |= ["announced_at", "results_submitted_at", "results_posted_at", "report_posted_at"] if admin_mode paginate json: competitions, only: ["id", "name", "start_date", "end_date", "registration_open", "registration_close", "venue"], diff --git a/app/webpacker/components/CompetitionsOverview/ListViewSection.js b/app/webpacker/components/CompetitionsOverview/ListViewSection.js index 2aaf6f47cb..bb63de0894 100644 --- a/app/webpacker/components/CompetitionsOverview/ListViewSection.js +++ b/app/webpacker/components/CompetitionsOverview/ListViewSection.js @@ -15,8 +15,8 @@ import { isProbablyOver, PseudoLinkMarkdown, reportAdminCellContent, + resultsSubmittedAtAdminCellContent, startYear, - timeDifferenceAfter, timeDifferenceBefore, } from '../../lib/utils/competition-table'; import { countries } from '../../lib/wca-data.js.erb'; @@ -389,11 +389,7 @@ function AdminCompetitionsTable({ warning={resultsPostedStatus === 'warning'} error={resultsPostedStatus === 'danger'} > - { - comp.results_posted_at - ? timeDifferenceAfter(comp, comp.results_posted_at) - : (isProbablyOver(comp) && I18n.t('competitions.competition_info.pending')) - } + {resultsSubmittedAtAdminCellContent(comp)}