fix: allow deleting previewed restore runs
Treat previewed as deletable for hygiene; keeps partial deletable too.
This commit is contained in:
parent
0a6e1f7751
commit
d718a127c5
@ -36,7 +36,7 @@ public function backupSet(): BelongsTo
|
|||||||
|
|
||||||
public function scopeDeletable($query)
|
public function scopeDeletable($query)
|
||||||
{
|
{
|
||||||
return $query->whereIn('status', ['completed', 'failed', 'aborted', 'completed_with_errors', 'partial']);
|
return $query->whereIn('status', ['completed', 'failed', 'aborted', 'completed_with_errors', 'partial', 'previewed']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isDeletable(): bool
|
public function isDeletable(): bool
|
||||||
@ -44,6 +44,6 @@ public function isDeletable(): bool
|
|||||||
$status = strtolower(trim((string) $this->status));
|
$status = strtolower(trim((string) $this->status));
|
||||||
$status = str_replace([' ', '-'], '_', $status);
|
$status = str_replace([' ', '-'], '_', $status);
|
||||||
|
|
||||||
return in_array($status, ['completed', 'failed', 'aborted', 'completed_with_errors', 'partial'], true);
|
return in_array($status, ['completed', 'failed', 'aborted', 'completed_with_errors', 'partial', 'previewed'], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
'aborted',
|
'aborted',
|
||||||
'completed_with_errors',
|
'completed_with_errors',
|
||||||
'partial',
|
'partial',
|
||||||
|
'previewed',
|
||||||
'running',
|
'running',
|
||||||
'pending',
|
'pending',
|
||||||
];
|
];
|
||||||
@ -52,6 +53,7 @@
|
|||||||
'completed_with_errors',
|
'completed_with_errors',
|
||||||
'failed',
|
'failed',
|
||||||
'partial',
|
'partial',
|
||||||
|
'previewed',
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user