Browse Source

Display only 2 available slots

theenglishway (time) 4 years ago
parent
commit
cbf8cee40b
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lib/vaccins_web/live/location_component.ex

+ 3 - 3
lib/vaccins_web/live/location_component.ex

@@ -134,15 +134,15 @@ defmodule VaccinsWeb.LocationComponent do
        when is_list(after_slots),
        do:
          assigns
-         |> Map.put(:slots_after, after_slots |> Enum.take(5))
+         |> Map.put(:slots_after, after_slots |> Enum.take(2))
          |> Map.put(:slots_before, [])
 
   defp integrate_availabilities(assigns = %{availabilities: {:ok, before_slots, after_slots}})
        when is_list(before_slots),
        do:
          assigns
-         |> Map.put(:slots_after, after_slots |> Enum.take(5))
-         |> Map.put(:slots_before, before_slots |> Enum.take(5))
+         |> Map.put(:slots_after, after_slots |> Enum.take(2))
+         |> Map.put(:slots_before, before_slots |> Enum.take(2))
          |> Map.put(:last_early_slot_seen, DateTime.utc_now())
 
   defp integrate_availabilities(assigns), do: assigns