Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

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

Andras Bacsai0603ab13c267
diff --git a/app/Livewire/Project/New/Select.php b/app/Livewire/Project/New/Select.php
index 396930c403..ac07413d4b 100644
--- a/app/Livewire/Project/New/Select.php
+++ b/app/Livewire/Project/New/Select.php
@@ -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,
]);
}