mirror of
https://github.com/wanderer-industries/wanderer
synced 2026-08-24 23:06:42 +00:00
Merge branch 'main' of github.com:wanderer-industries/wanderer
This commit is contained in:
@@ -2,6 +2,15 @@
|
||||
|
||||
<!-- changelog -->
|
||||
|
||||
## [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)
|
||||
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
[
|
||||
|
||||
@@ -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, %{
|
||||
|
||||
Reference in New Issue
Block a user