From 49e9440e0f9c055dd44d36a9e93ac22fab6f95d5 Mon Sep 17 00:00:00 2001 From: Boy132 Date: Thu, 7 Aug 2025 11:16:32 +0200 Subject: [PATCH] Fix server creation without deployment (#1569) --- app/Services/Servers/ServerCreationService.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/Services/Servers/ServerCreationService.php b/app/Services/Servers/ServerCreationService.php index 6fd76e55c..276311ebe 100644 --- a/app/Services/Servers/ServerCreationService.php +++ b/app/Services/Servers/ServerCreationService.php @@ -39,15 +39,7 @@ class ServerCreationService * as possible given the input data. For example, if an allocation_id is passed with * no node_id the node_is will be picked from the allocation. * - * @param array{ - * node_id?: int, - * oom_killer?: bool, - * oom_disabled?: bool, - * egg_id?: int, - * image?: ?string, - * startup?: ?string, - * start_on_completion?: ?bool, - * } $data + * @param array $data * * @throws \Throwable * @throws \App\Exceptions\DisplayException @@ -94,6 +86,8 @@ class ServerCreationService if (empty($data['node_id'])) { $data['node_id'] = $nodes->first(); } + } else { + $data['node_id'] = Allocation::find($data['allocation_id'])?->node_id; } Assert::false(empty($data['node_id']), 'Expected a non-empty node_id in server creation data.');