fix(select-component): handle exceptions during parameter retrieval and environment selection in the mount method
This commit is contained in:
parent
9471bd2fbb
commit
32a14b0050
1 changed files with 11 additions and 6 deletions
|
|
@ -57,13 +57,18 @@ class Select extends Component
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
$this->parameters = get_route_parameters();
|
try {
|
||||||
if (isDev()) {
|
$this->parameters = get_route_parameters();
|
||||||
$this->existingPostgresqlUrl = 'postgres://coolify:password@coolify-db:5432';
|
if (isDev()) {
|
||||||
|
$this->existingPostgresqlUrl = 'postgres://coolify:password@coolify-db:5432';
|
||||||
|
}
|
||||||
|
$projectUuid = data_get($this->parameters, 'project_uuid');
|
||||||
|
$project = Project::whereUuid($projectUuid)->firstOrFail();
|
||||||
|
$this->environments = $project->environments;
|
||||||
|
$this->selectedEnvironment = $this->environments->where('uuid', data_get($this->parameters, 'environment_uuid'))->firstOrFail()->name;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return handleError($e, $this);
|
||||||
}
|
}
|
||||||
$projectUuid = data_get($this->parameters, 'project_uuid');
|
|
||||||
$this->environments = Project::whereUuid($projectUuid)->first()->environments;
|
|
||||||
$this->selectedEnvironment = $this->environments->where('uuid', data_get($this->parameters, 'environment_uuid'))->first()->name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render()
|
public function render()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue