improve navigation
This commit is contained in:
@@ -5,7 +5,6 @@ namespace App\Livewire\Project;
|
||||
use App\Models\PrivateKey;
|
||||
use App\Models\Project;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Livewire\Component;
|
||||
|
||||
class Index extends Component
|
||||
@@ -34,15 +33,8 @@ class Index extends Component
|
||||
|
||||
public function navigateToProject($projectUuid)
|
||||
{
|
||||
$project = Project::where('uuid', $projectUuid)->first();
|
||||
$project = collect($this->projects)->firstWhere('uuid', $projectUuid);
|
||||
|
||||
if ($project && $project->environments->count() === 1) {
|
||||
return Redirect::route('project.resource.index', [
|
||||
'project_uuid' => $projectUuid,
|
||||
'environment_uuid' => $project->environments->first()->uuid,
|
||||
]);
|
||||
}
|
||||
|
||||
return Redirect::route('project.show', ['project_uuid' => $projectUuid]);
|
||||
return $this->redirect($project->navigateTo(), true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user