diff --git a/lib/exmr_web/live/exam_live/index.ex b/lib/exmr_web/live/exam_live/index.ex index 501ec7a..bc05f1f 100644 --- a/lib/exmr_web/live/exam_live/index.ex +++ b/lib/exmr_web/live/exam_live/index.ex @@ -46,6 +46,7 @@ defmodule ExmrWeb.ExamLive.Index do socket = socket |> assign(:exams, [exam | socket.assigns.exams]) + |> assign(events: Enum.group_by(Exams.list_exams(), & &1.date)) {:noreply, socket} end @@ -60,6 +61,7 @@ defmodule ExmrWeb.ExamLive.Index do |> update(:exams, fn exams -> Enum.reject(exams, fn l -> l.id == exam.id end) end) + |> assign(events: Enum.group_by(Exams.list_exams(), & &1.date)) {:noreply, socket} end diff --git a/lib/exmr_web/live/exam_live/index.html.heex b/lib/exmr_web/live/exam_live/index.html.heex index d51dfb1..eca1b7a 100644 --- a/lib/exmr_web/live/exam_live/index.html.heex +++ b/lib/exmr_web/live/exam_live/index.html.heex @@ -79,15 +79,15 @@ -