feat: sort on load
This commit is contained in:
parent
d9f13671d3
commit
6e7e799a82
1 changed files with 1 additions and 1 deletions
|
@ -8,8 +8,8 @@ defmodule ExmrWeb.ExamLive.Index do
|
||||||
def mount(_params, _session, socket) do
|
def mount(_params, _session, socket) do
|
||||||
socket =
|
socket =
|
||||||
socket
|
socket
|
||||||
|> assign(:exams, Exams.list_exams())
|
|
||||||
|> assign(:sort_by, "date")
|
|> assign(:sort_by, "date")
|
||||||
|
|> assign(:exams, sort_items(Exams.list_exams(), "date"))
|
||||||
|> assign(:live_action, :index)
|
|> assign(:live_action, :index)
|
||||||
|> assign(exam: %{})
|
|> assign(exam: %{})
|
||||||
|> assign(events: Enum.group_by(Exams.list_exams(), & &1.date))
|
|> assign(events: Enum.group_by(Exams.list_exams(), & &1.date))
|
||||||
|
|
Loading…
Reference in a new issue