Fix container deletion endpoint
This commit is contained in:
+3
-1
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user