chore(Map): Added ping system to routes

This commit is contained in:
Dmitry Popov
2025-05-20 15:31:38 +02:00
parent 6914f75bb7
commit 3cd9b819f5
@@ -56,13 +56,21 @@ defmodule WandererAppWeb.MapRoutesEventHandler do
{:ok, hubs} = map_id |> WandererApp.Map.list_hubs()
{:ok, pings} = WandererApp.MapPingsRepo.get_by_map(map_id)
ping_system_ids =
pings
|> Enum.map(fn %{system: %{solar_system_id: solar_system_id}} -> "#{solar_system_id}" end)
route_hubs = (ping_system_ids ++ hubs) |> Enum.uniq()
is_hubs_limit_reached = hubs |> Enum.count() > hubs_limit
Task.async(fn ->
{:ok, routes} =
WandererApp.Maps.find_routes(
map_id,
hubs,
route_hubs,
solar_system_id,
get_routes_settings(routes_settings),
is_hubs_limit_reached