refactor(clone-project): enhance server retrieval by including destinations and filtering out build servers

This commit is contained in:
Andras Bacsai 2025-06-16 13:15:40 +02:00
parent f9a0ca2ca6
commit 87225405a8

View file

@ -54,7 +54,11 @@ public function mount($project_uuid)
$this->project = Project::where('uuid', $project_uuid)->firstOrFail();
$this->environment = $this->project->environments->where('uuid', $this->environment_uuid)->first();
$this->project_id = $this->project->id;
$this->servers = currentTeam()->servers;
$this->servers = currentTeam()
->servers()
->with('destinations')
->get()
->reject(fn ($server) => $server->isBuildServer());
$this->newName = str($this->project->name.'-clone-'.(string) new Cuid2)->slug();
}