|
@@ -25,7 +25,7 @@ defmodule VaccinsWeb.IndexLive do
|
|
|
@impl true
|
|
@impl true
|
|
|
def handle_event("add_location", %{"location_raw" => params}, socket) do
|
|
def handle_event("add_location", %{"location_raw" => params}, socket) do
|
|
|
case params |> LocationStore.add_location() do
|
|
case params |> LocationStore.add_location() do
|
|
|
- :ok -> {:noreply, socket}
|
|
|
|
|
|
|
+ :ok -> {:noreply, socket |> push_patch(to: Routes.index_path(socket, :index))}
|
|
|
{:error, cs} -> {:noreply, socket |> assign(location_cs: cs)}
|
|
{:error, cs} -> {:noreply, socket |> assign(location_cs: cs)}
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
@@ -64,6 +64,9 @@ defmodule VaccinsWeb.IndexLive do
|
|
|
|> update(:locations_with_early_slots, &(&1 |> MapSet.delete(id)))}
|
|
|> update(:locations_with_early_slots, &(&1 |> MapSet.delete(id)))}
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+ def handle_info({:location_deleted, _}, socket),
|
|
|
|
|
+ do: socket |> push_patch(to: Routes.index_path(socket, :index))
|
|
|
|
|
+
|
|
|
@impl true
|
|
@impl true
|
|
|
def handle_info(
|
|
def handle_info(
|
|
|
{:query_result, ref, res},
|
|
{:query_result, ref, res},
|