fix: no environments

This commit is contained in:
Andras Bacsai 2023-11-06 10:48:30 +01:00
parent 2c6ece62bb
commit 6840ddd3e6

View File

@ -32,8 +32,14 @@ public function projects()
public function environments()
{
$project = Project::ownedByCurrentTeam()->whereUuid(request()->query('project_uuid'))->first();
if (!$project) {
return response()->json([
'environments' => []
]);
}
return response()->json([
'environments' => Project::ownedByCurrentTeam()->whereUuid(request()->query('project_uuid'))->first()->environments
'environments' => $project->environments
]);
}