Clean up setting allocation front-end

This commit is contained in:
Dane Everitt 2016-01-08 22:36:57 -05:00
parent b41e7ecf09
commit a1c6aa6358
3 changed files with 43 additions and 4 deletions

View file

@ -183,6 +183,12 @@ class AjaxController extends Controller
$server = Server::getByUUID($uuid);
$this->authorize('set-connection', $server);
if ($request->input('connection') === $server->ip . ':' . $server->port) {
return response()->json([
'error' => 'You are already using this as your default connection.'
], 409);
}
try {
$repo = new Repositories\ServerRepository;