fix: Handle project not found error in environment_details API endpoint
This commit is contained in:
parent
22bd305e8f
commit
08b9c79298
1 changed files with 3 additions and 0 deletions
|
|
@ -145,6 +145,9 @@ public function environment_details(Request $request)
|
|||
return response()->json(['message' => 'Environment name is required.'], 422);
|
||||
}
|
||||
$project = Project::whereTeamId($teamId)->whereUuid($request->uuid)->first();
|
||||
if (! $project) {
|
||||
return response()->json(['message' => 'Project not found.'], 404);
|
||||
}
|
||||
$environment = $project->environments()->whereName($request->environment_name)->first();
|
||||
if (! $environment) {
|
||||
return response()->json(['message' => 'Environment not found.'], 404);
|
||||
|
|
|
|||
Loading…
Reference in a new issue