Initial implementation of improved sever model and logic

This commit is contained in:
Dane Everitt 2017-02-02 18:21:36 -05:00
parent fb589a7f4e
commit d4bcf0be59
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
31 changed files with 223 additions and 158 deletions

View file

@ -73,7 +73,7 @@ class AjaxController extends Controller
return response()->json([], 404);
}
$client = Models\Node::guzzleRequest($server->node);
$client = Models\Node::guzzleRequest($server->node_id);
try {
$res = $client->request('GET', '/server', [
@ -178,7 +178,7 @@ class AjaxController extends Controller
$server = Models\Server::getByUUID($uuid);
$this->authorize('set-connection', $server);
if ((int) $request->input('allocation') === $server->allocation) {
if ((int) $request->input('allocation') === $server->allocation_id) {
return response()->json([
'error' => 'You are already using this as your default connection.',
], 409);