fix dashes on the name and better error handling (#336)

This commit is contained in:
Saeed Vaziry
2024-11-02 22:44:02 +01:00
committed by GitHub
parent f743611b22
commit 6639fac9c0
16 changed files with 53 additions and 96 deletions

View File

@ -6,8 +6,6 @@
use App\Models\Backup;
use App\Models\BackupFile;
use App\Models\Server;
use Exception;
use Filament\Notifications\Notification;
use Filament\Support\Enums\MaxWidth;
use Filament\Tables\Actions\Action;
use Filament\Tables\Columns\TextColumn;
@ -95,18 +93,10 @@ public function getTable(): Table
->authorize(fn (Backup $record) => auth()->user()->can('delete', $record))
->requiresConfirmation()
->action(function (Backup $record) {
try {
run_action($this, function () use ($record) {
$record->delete();
} catch (Exception $e) {
Notification::make()
->danger()
->title($e->getMessage())
->send();
throw $e;
}
$this->dispatch('$refresh');
$this->dispatch('$refresh');
});
}),
]);
}