Parcourir la source

Fix duplicate route error by removing redundant userWatchStats test endpoint

- Removed duplicate /test/userWatchStats route at line 790-811
- The original route at line 147-168 was already present and functional
- This fixes the FastRoute\BadRouteException: 'Cannot register two routes matching "/api/v2/test/userWatchStats"'
- Only the /test/jellystat endpoint was actually needed as it was missing
mgomon il y a 8 mois
Parent
commit
fa4a8539a9
1 fichiers modifiés avec 0 ajouts et 22 suppressions
  1. 0 22
      api/v2/routes/connectionTester.php

+ 0 - 22
api/v2/routes/connectionTester.php

@@ -787,25 +787,3 @@ $app->post('/test/jellystat', function ($request, $response, $args) {
 		->withHeader('Content-Type', 'application/json;charset=UTF-8')
 		->withStatus($GLOBALS['responseCode']);
 });
-$app->post('/test/userWatchStats', function ($request, $response, $args) {
-	/**
-	 * @OA\Post(
-	 *     security={{ "api_key":{} }},
-	 *     tags={"test connection"},
-	 *     path="/api/v2/test/userWatchStats",
-	 *     summary="Test connection to User Watch Stats",
-	 *     @OA\Response(response="200",description="Success",@OA\JsonContent(ref="#/components/schemas/success-message")),
-	 *     @OA\Response(response="401",description="Unauthorized",@OA\JsonContent(ref="#/components/schemas/unauthorized-message")),
-	 *     @OA\Response(response="422",description="Error",@OA\JsonContent(ref="#/components/schemas/error-message")),
-	 *     @OA\Response(response="500",description="Error",@OA\JsonContent(ref="#/components/schemas/error-message")),
-	 * )
-	 */
-	$Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
-	if ($Organizr->qualifyRequest(1, true)) {
-		$Organizr->testConnectionUserWatchStats();
-	}
-	$response->getBody()->write(jsonE($GLOBALS['api']));
-	return $response
-		->withHeader('Content-Type', 'application/json;charset=UTF-8')
-		->withStatus($GLOBALS['responseCode']);
-});