refactor: Remove unused variables and improve code readability

This commit is contained in:
Andras Bacsai
2024-06-06 11:09:27 +02:00
parent f71a8e9fef
commit 463021a9f3
4 changed files with 2 additions and 4 deletions

View File

@@ -7,7 +7,6 @@ use Livewire\Component;
class Index extends Component class Index extends Component
{ {
public $database; public $database;
public $s3s;
public function mount() public function mount()
{ {
$project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first(); $project = currentTeam()->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first();
@@ -36,7 +35,6 @@ class Index extends Component
]); ]);
} }
$this->database = $database; $this->database = $database;
$this->s3s = currentTeam()->s3s;
} }
public function render() public function render()
{ {

View File

@@ -25,6 +25,7 @@ class CreateScheduledBackup extends Component
]; ];
public function mount() public function mount()
{ {
$this->s3s = currentTeam()->s3s;
if ($this->s3s->count() > 0) { if ($this->s3s->count() > 0) {
$this->s3_storage_id = $this->s3s->first()->id; $this->s3_storage_id = $this->s3s->first()->id;
} }

View File

@@ -38,7 +38,6 @@
</div> </div>
@endif @endif
@if ($application->build_pack === 'dockercompose') @if ($application->build_pack === 'dockercompose')
@if ( @if (
!is_null($parsedServices) && !is_null($parsedServices) &&
count($parsedServices) > 0 && count($parsedServices) > 0 &&

View File

@@ -6,7 +6,7 @@
<div class="flex gap-2"> <div class="flex gap-2">
<h2 class="pb-4">Scheduled Backups</h2> <h2 class="pb-4">Scheduled Backups</h2>
<x-modal-input buttonTitle="+ Add" title="New Scheduled Backup"> <x-modal-input buttonTitle="+ Add" title="New Scheduled Backup">
<livewire:project.database.create-scheduled-backup :database="$database" :s3s="$s3s" /> <livewire:project.database.create-scheduled-backup :database="$database" />
</x-modal-input> </x-modal-input>
</div> </div>
<livewire:project.database.scheduled-backups :database="$database" /> <livewire:project.database.scheduled-backups :database="$database" />