feat: cleanup sentinel on server deletion

fix: Sentinel should not be enabled on build servers
This commit is contained in:
Andras Bacsai
2024-10-17 11:21:43 +02:00
parent b58ff07832
commit 4c95647b96
8 changed files with 27 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
use App\Actions\Server\RemoveServer;
use App\Actions\Server\ValidateServer;
use App\Enums\ProxyStatus;
use App\Enums\ProxyTypes;
@@ -725,7 +726,7 @@ class ServersController extends Controller
if ($server->definedResources()->count() > 0) {
return response()->json(['message' => 'Server has resources, so you need to delete them before.'], 400);
}
$server->delete();
RemoveServer::dispatch($server);
return response()->json(['message' => 'Server deleted.']);
}