Skip to content

Commit dcab84b

Browse files
committed
Fix bug with server default ports not being updated properly
1 parent 81d265d commit dcab84b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/Repositories/ServerRepository.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ public function changeBuild($id, array $data)
535535
}
536536

537537
$newPorts = true;
538-
$firstNewAllocation = (is_null($firstNewAllocation)) ? $model->id : $firstNewAllocation;
538+
$firstNewAllocation = $firstNewAllocation ?? $model;
539539
$model->update([
540540
'server_id' => $server->id,
541541
]);
@@ -555,7 +555,8 @@ public function changeBuild($id, array $data)
555555
}
556556

557557
// New Allocation, set as the default.
558-
$server->allocation_id = $firstNewAllocation;
558+
$server->allocation_id = $firstNewAllocation->id;
559+
$newBuild['default'] = ['ip' => $firstNewAllocation->ip, 'port' => $firstNewAllocation->port];
559560
}
560561

561562
$newPorts = true;

0 commit comments

Comments
 (0)