fix: refactor database view

This commit is contained in:
Andras Bacsai
2024-12-17 12:10:55 +01:00
parent 43be0f4075
commit 38256af9b3
7 changed files with 145 additions and 144 deletions

View File

@@ -3,7 +3,6 @@
namespace App\Livewire\Project\Application;
use App\Models\Application;
use App\Models\Server;
use Livewire\Component;
class Configuration extends Component
@@ -40,15 +39,7 @@ class Configuration extends Component
$this->project = $project;
$this->environment = $environment;
$this->application = $application;
if ($application->destination && $application->destination->server) {
$mainServer = $application->destination->server;
$this->servers = Server::ownedByCurrentTeam()
->select('id', 'name')
->where('id', '!=', $mainServer->id)
->get();
} else {
$this->servers = collect();
}
}
public function render()