From 526ff36f1b8db2b371c326063b7557c596d39d4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Mon, 5 Aug 2024 13:50:43 +0900 Subject: [PATCH] Fix podium events order --- lib/wca_live/scoretaking.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/wca_live/scoretaking.ex b/lib/wca_live/scoretaking.ex index 11b663d5..b747460f 100644 --- a/lib/wca_live/scoretaking.ex +++ b/lib/wca_live/scoretaking.ex @@ -580,7 +580,9 @@ defmodule WcaLive.Scoretaking do |> Repo.all() |> Repo.preload(rounds: :results) - Enum.map(competition_events, fn competition_event -> + competition_events + |> Enum.sort_by(&Event.get_rank_by_id!(&1.event_id)) + |> Enum.map(fn competition_event -> final_round = Enum.max_by(competition_event.rounds, & &1.number) podium_results =