From 93e4e723fab8b3d5679a39bd89db6ce4b09afb6c Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 7 Mar 2024 15:45:49 +0100 Subject: [PATCH] Add documentation links to error responses in Team controller --- app/Http/Controllers/Api/Team.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/Team.php b/app/Http/Controllers/Api/Team.php index 862d2e185..540ac282a 100644 --- a/app/Http/Controllers/Api/Team.php +++ b/app/Http/Controllers/Api/Team.php @@ -26,7 +26,7 @@ public function team_by_id(Request $request) $teams = auth()->user()->teams; $team = $teams->where('id', $id)->first(); if (is_null($team)) { - return response()->json(['error' => 'Team not found.'], 404); + return response()->json(['error' => 'Team not found.', "docs" => "https://coolify.io/docs/api/team-by-id"], 404); } return response()->json($team); } @@ -40,7 +40,7 @@ public function members_by_id(Request $request) $teams = auth()->user()->teams; $team = $teams->where('id', $id)->first(); if (is_null($team)) { - return response()->json(['error' => 'Team not found.'], 404); + return response()->json(['error' => 'Team not found.', "docs" => "https://coolify.io/docs/api/team-by-members"], 404); } return response()->json($team->members); } @@ -53,7 +53,8 @@ public function current_team(Request $request) $team = auth()->user()->currentTeam(); return response()->json($team); } - public function current_team_members(Request $request) { + public function current_team_members(Request $request) + { $teamId = get_team_id_from_token(); if (is_null($teamId)) { return invalid_token();