fix: server proxy set correctly through the API
fix: cannto delete localhost through the API.
This commit is contained in:
parent
eaf546fe75
commit
f35f45324b
1 changed files with 7 additions and 4 deletions
|
|
@ -530,11 +530,11 @@ public function create_server(Request $request)
|
|||
'user' => $request->user,
|
||||
'private_key_id' => $privateKey->id,
|
||||
'team_id' => $teamId,
|
||||
'proxy' => [
|
||||
'type' => $proxyType,
|
||||
'status' => ProxyStatus::EXITED->value,
|
||||
],
|
||||
]);
|
||||
$server->proxy->set('type', $proxyType);
|
||||
$server->proxy->set('status', ProxyStatus::EXITED->value);
|
||||
$server->save();
|
||||
|
||||
$server->settings()->update([
|
||||
'is_build_server' => $request->is_build_server,
|
||||
]);
|
||||
|
|
@ -742,6 +742,9 @@ public function delete_server(Request $request)
|
|||
if ($server->definedResources()->count() > 0) {
|
||||
return response()->json(['message' => 'Server has resources, so you need to delete them before.'], 400);
|
||||
}
|
||||
if ($server->isLocalhost()) {
|
||||
return response()->json(['message' => 'Local server cannot be deleted.'], 400);
|
||||
}
|
||||
$server->delete();
|
||||
DeleteServer::dispatch($server);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue