|
|
@@ -98,16 +98,18 @@ defmodule VaccinsWeb.IndexLive do
|
|
|
) do
|
|
|
locations
|
|
|
|> Enum.sort(fn e1, e2 ->
|
|
|
- e1_has_early_spot? = e1 in with_early_slots
|
|
|
- e1_has_spot? = e1 in with_slots
|
|
|
- e2_has_early_spot? = e2 in with_early_slots
|
|
|
- e2_has_spot? = e2 in with_slots
|
|
|
-
|
|
|
- cond do
|
|
|
- e1_has_early_spot? and not e2_has_early_spot? -> true
|
|
|
- e1_has_spot? and not e2_has_early_spot? and not e2_has_spot? -> true
|
|
|
- true -> false
|
|
|
- end
|
|
|
+ e1_has_early_spot? = e1.id in with_early_slots
|
|
|
+ e1_has_spot? = e1.id in with_slots
|
|
|
+ e2_has_early_spot? = e2.id in with_early_slots
|
|
|
+ e2_has_spot? = e2.id in with_slots
|
|
|
+
|
|
|
+ res =
|
|
|
+ cond do
|
|
|
+ e2_has_early_spot? -> false
|
|
|
+ e2_has_spot? and not e1_has_early_spot? -> false
|
|
|
+ e2_has_spot? and e1_has_spot? -> false
|
|
|
+ true -> true
|
|
|
+ end
|
|
|
end)
|
|
|
end
|
|
|
end
|