mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-22 08:23:49 +00:00
refactor(backups): centralize storage deletion guard
This commit is contained in:
@@ -4910,13 +4910,7 @@ class ApplicationsController extends Controller
|
||||
], 422);
|
||||
}
|
||||
|
||||
if ($storage->scheduledBackups()->exists()) {
|
||||
return response()->json([
|
||||
'message' => $storage instanceof LocalFileVolume
|
||||
? 'Delete this directory backup schedule and its archives before deleting the directory.'
|
||||
: 'Delete this volume backup schedule and its archives before deleting the volume.',
|
||||
], 422);
|
||||
}
|
||||
$storage->abortIfScheduledBackupsExist();
|
||||
|
||||
if ($storage instanceof LocalFileVolume) {
|
||||
$storage->deleteStorageOnServer();
|
||||
|
||||
Reference in New Issue
Block a user