diff --git a/CHANGELOG.md b/CHANGELOG.md index bda50cc9..7783b9c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ +## [v1.81.2](https://github.com/wanderer-industries/wanderer/compare/v1.81.1...v1.81.2) (2025-10-07) + + + + +### Bug Fixes: + +* api dropping custom name + ## [v1.81.1](https://github.com/wanderer-industries/wanderer/compare/v1.81.0...v1.81.1) (2025-10-02) diff --git a/lib/wanderer_app_web/controllers/map_system_api_controller.ex b/lib/wanderer_app_web/controllers/map_system_api_controller.ex index 07543519..c9e25b8d 100644 --- a/lib/wanderer_app_web/controllers/map_system_api_controller.ex +++ b/lib/wanderer_app_web/controllers/map_system_api_controller.ex @@ -80,6 +80,11 @@ defmodule WandererAppWeb.MapSystemAPIController do properties: %{ solar_system_id: %Schema{type: :integer, description: "EVE solar system ID"}, solar_system_name: %Schema{type: :string, description: "EVE solar system name"}, + custom_name: %Schema{ + type: :string, + nullable: true, + description: "Custom name for the system" + }, position_x: %Schema{type: :integer, description: "X coordinate"}, position_y: %Schema{type: :integer, description: "Y coordinate"}, status: %Schema{ @@ -98,6 +103,7 @@ defmodule WandererAppWeb.MapSystemAPIController do example: %{ solar_system_id: 30_000_142, solar_system_name: "Jita", + custom_name: "Trade Hub", position_x: 100, position_y: 200, visible: true, @@ -113,6 +119,11 @@ defmodule WandererAppWeb.MapSystemAPIController do description: "EVE solar system name", nullable: true }, + custom_name: %Schema{ + type: :string, + nullable: true, + description: "Custom name for the system" + }, position_x: %Schema{type: :integer, description: "X coordinate", nullable: true}, position_y: %Schema{type: :integer, description: "Y coordinate", nullable: true}, status: %Schema{ @@ -130,6 +141,7 @@ defmodule WandererAppWeb.MapSystemAPIController do }, example: %{ solar_system_name: "Jita", + custom_name: "Trade Hub", position_x: 101, position_y: 202, visible: false, diff --git a/lib/wanderer_app_web/helpers/api_utils.ex b/lib/wanderer_app_web/helpers/api_utils.ex index 3b4db3a9..474a1b11 100644 --- a/lib/wanderer_app_web/helpers/api_utils.ex +++ b/lib/wanderer_app_web/helpers/api_utils.ex @@ -118,6 +118,7 @@ defmodule WandererAppWeb.Helpers.APIUtils do optional = [ "solar_system_name", + "custom_name", "position_x", "position_y", "coordinates", @@ -151,6 +152,7 @@ defmodule WandererAppWeb.Helpers.APIUtils do def extract_update_params(params) when is_map(params) do allowed = [ "solar_system_name", + "custom_name", "position_x", "position_y", "coordinates", diff --git a/mix.exs b/mix.exs index 6ced3e23..f634d901 100644 --- a/mix.exs +++ b/mix.exs @@ -3,7 +3,7 @@ defmodule WandererApp.MixProject do @source_url "https://github.com/wanderer-industries/wanderer" - @version "1.81.1" + @version "1.81.2" def project do [ diff --git a/test/integration/map_system_api_controller_success_test.exs b/test/integration/map_system_api_controller_success_test.exs index d0e36e60..81e6b60b 100644 --- a/test/integration/map_system_api_controller_success_test.exs +++ b/test/integration/map_system_api_controller_success_test.exs @@ -127,6 +127,31 @@ defmodule WandererAppWeb.MapSystemAPIControllerSuccessTest do assert updated_system["position_y"] == 400.0 end + test "UPDATE: successfully updates custom_name", %{conn: conn, map: map} do + system = + insert(:map_system, %{ + map_id: map.id, + solar_system_id: 30_000_142, + name: "Jita", + position_x: 100, + position_y: 200 + }) + + update_params = %{ + "custom_name" => "My Trade Hub" + } + + conn = put(conn, ~p"/api/maps/#{map.slug}/systems/#{system.id}", update_params) + + response = json_response(conn, 200) + + assert %{ + "data" => updated_system + } = response + + assert updated_system["custom_name"] == "My Trade Hub" + end + test "DELETE: successfully deletes a system", %{conn: conn, map: map} do system = insert(:map_system, %{