mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-12 10:45:54 +00:00
fix: add test coverage for api
This commit is contained in:
@@ -91,7 +91,7 @@ defmodule WandererAppWeb.CommonAPIController do
|
||||
with {:ok, solar_system_str} <- APIUtils.require_param(params, "id"),
|
||||
{:ok, solar_system_id} <- APIUtils.parse_int(solar_system_str) do
|
||||
case CachedInfo.get_system_static_info(solar_system_id) do
|
||||
{:ok, system} ->
|
||||
{:ok, system} when not is_nil(system) ->
|
||||
# Get basic system data
|
||||
data = static_system_to_json(system)
|
||||
|
||||
@@ -105,6 +105,11 @@ defmodule WandererAppWeb.CommonAPIController do
|
||||
conn
|
||||
|> put_status(:not_found)
|
||||
|> json(%{error: "System not found"})
|
||||
|
||||
{:ok, nil} ->
|
||||
conn
|
||||
|> put_status(:not_found)
|
||||
|> json(%{error: "System not found"})
|
||||
end
|
||||
else
|
||||
{:error, msg} ->
|
||||
|
||||
Reference in New Issue
Block a user