Fix container deletion endpoint

This commit is contained in:
Hermes Agent
2026-09-20 15:55:45 +00:00
parent f45cc35bf7
commit bb54439e57
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -150,7 +150,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$db->prepare('UPDATE instances SET portainer_container_id = :cid, status = "running", error_message = NULL WHERE id = :id')->execute(['cid' => $newContainerId, 'id' => $instanceId]);
$message = 'Die Instanz wurde neu bereitgestellt. Die Daten in /data wurden beibehalten.';
} else {
$apiPath = '/api/endpoints/' . $endpoint . '/docker/containers/' . $containerId . '/' . $operation;
$apiPath = $operation === 'delete'
? '/api/endpoints/' . $endpoint . '/docker/containers/' . $containerId . '?force=true'
: '/api/endpoints/' . $endpoint . '/docker/containers/' . $containerId . '/' . $operation;
pnpaas_portainer_request($apiPath, $operation === 'delete' ? 'DELETE' : 'POST', []);
$newStatus = match ($operation) {
'start', 'restart' => 'running',