From c66f250cd94e000d1a704beee965ca1008fb4a3d Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 10 Aug 2023 16:28:29 +0200 Subject: [PATCH] Able to remove scheduled backups --- app/Http/Livewire/Project/Database/BackupEdit.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Http/Livewire/Project/Database/BackupEdit.php b/app/Http/Livewire/Project/Database/BackupEdit.php index 3a0824c10..c802bf202 100644 --- a/app/Http/Livewire/Project/Database/BackupEdit.php +++ b/app/Http/Livewire/Project/Database/BackupEdit.php @@ -7,6 +7,7 @@ use Livewire\Component; class BackupEdit extends Component { public $backup; + public array $parameters; protected $rules = [ 'backup.enabled' => 'required|boolean', @@ -19,11 +20,16 @@ class BackupEdit extends Component 'backup.number_of_backups_locally' => 'Number of Backups Locally', ]; + public function mount() + { + $this->parameters = get_route_parameters(); + } + public function delete() { + // TODO: Delete backup from server and add a confirmation modal $this->backup->delete(); - $this->emit('success', 'Backup deleted successfully'); - $this->emit('refreshScheduledBackups'); + redirect()->route('project.database.backups.all', $this->parameters); } public function instantSave()