refactor(backups): centralize storage deletion guard

This commit is contained in:
Andras Bacsai
2026-07-19 23:20:46 +02:00
parent 4e03be755d
commit bf72fd5d88
6 changed files with 38 additions and 21 deletions
@@ -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();