From 2c1b30b39e78795881303ab77f8791daf0fc48b5 Mon Sep 17 00:00:00 2001 From: endoooo Date: Tue, 5 Mar 2024 10:52:08 -0300 Subject: [PATCH] fixes #72 --- .../curriculum/component/id/curriculum_component_live.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lanttern_web/live/pages/curriculum/component/id/curriculum_component_live.ex b/lib/lanttern_web/live/pages/curriculum/component/id/curriculum_component_live.ex index 32f237e0..a1958a5e 100644 --- a/lib/lanttern_web/live/pages/curriculum/component/id/curriculum_component_live.ex +++ b/lib/lanttern_web/live/pages/curriculum/component/id/curriculum_component_live.ex @@ -22,8 +22,8 @@ defmodule LantternWeb.CurriculumComponentLive do _ -> %{} end - selected_subjects_ids = Map.get(current_filters, :subjects_ids, []) - selected_years_ids = Map.get(current_filters, :years_ids, []) + selected_subjects_ids = Map.get(current_filters, :subjects_ids) || [] + selected_years_ids = Map.get(current_filters, :years_ids) || [] selected_subjects = Enum.filter(subjects, &(&1.id in selected_subjects_ids)) selected_years = Enum.filter(years, &(&1.id in selected_years_ids))