From 6e7e799a82fa7462b6c33c0032cf594231033b36 Mon Sep 17 00:00:00 2001 From: Vladimir Rubin Date: Wed, 25 Dec 2024 17:47:53 +0200 Subject: [PATCH] feat: sort on load --- lib/exmr_web/live/exam_live/index.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/exmr_web/live/exam_live/index.ex b/lib/exmr_web/live/exam_live/index.ex index bc05f1f..b2adc09 100644 --- a/lib/exmr_web/live/exam_live/index.ex +++ b/lib/exmr_web/live/exam_live/index.ex @@ -8,8 +8,8 @@ defmodule ExmrWeb.ExamLive.Index do def mount(_params, _session, socket) do socket = socket - |> assign(:exams, Exams.list_exams()) |> assign(:sort_by, "date") + |> assign(:exams, sort_items(Exams.list_exams(), "date")) |> assign(:live_action, :index) |> assign(exam: %{}) |> assign(events: Enum.group_by(Exams.list_exams(), & &1.date))