Fix bug with server default ports not being updated properly

This commit is contained in:
Dane Everitt 2017-06-18 21:03:39 -05:00
parent 81d265db08
commit dcab84b1da
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -535,7 +535,7 @@ class ServerRepository
} }
$newPorts = true; $newPorts = true;
$firstNewAllocation = (is_null($firstNewAllocation)) ? $model->id : $firstNewAllocation; $firstNewAllocation = $firstNewAllocation ?? $model;
$model->update([ $model->update([
'server_id' => $server->id, 'server_id' => $server->id,
]); ]);
@ -555,7 +555,8 @@ class ServerRepository
} }
// New Allocation, set as the default. // New Allocation, set as the default.
$server->allocation_id = $firstNewAllocation; $server->allocation_id = $firstNewAllocation->id;
$newBuild['default'] = ['ip' => $firstNewAllocation->ip, 'port' => $firstNewAllocation->port];
} }
$newPorts = true; $newPorts = true;