fix(project): update selected environment handling to use environment name instead of UUID

This commit is contained in:
Andras Bacsai
2025-05-22 14:35:31 +02:00
parent c97415a8ef
commit 0603ab13c2

View File

@@ -63,7 +63,7 @@ class Select extends Component
}
$projectUuid = data_get($this->parameters, 'project_uuid');
$this->environments = Project::whereUuid($projectUuid)->first()->environments;
$this->selectedEnvironment = data_get($this->parameters, 'environment_uuid');
$this->selectedEnvironment = $this->environments->where('uuid', data_get($this->parameters, 'environment_uuid'))->first()->name;
}
public function render()
@@ -73,9 +73,11 @@ class Select extends Component
public function updatedSelectedEnvironment()
{
$environmentUuid = $this->environments->where('name', $this->selectedEnvironment)->first()->uuid;
return redirect()->route('project.resource.create', [
'project_uuid' => $this->parameters['project_uuid'],
'environment_uuid' => $this->selectedEnvironment,
'environment_uuid' => $environmentUuid,
]);
}