]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/WallabagRestController.php
fix tests for GET /entries/tags
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / WallabagRestController.php
index a382caf757b61fbbd89de3adbe0bcc841dfe804d..e25ac6db8a545fd69bd96b7a0c46dc6e9319378c 100644 (file)
@@ -6,6 +6,7 @@ use Nelmio\ApiDocBundle\Annotation\ApiDoc;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\JsonResponse;
+use Symfony\Component\HttpFoundation\Response;
 use Wallabag\CoreBundle\Entity\Entry;
 use Wallabag\CoreBundle\Entity\Tag;
 use Wallabag\CoreBundle\Service\Extractor;
@@ -40,19 +41,15 @@ class WallabagRestController extends Controller
     /**
      * Retrieve salt for a giver user.
      *
-     * @ApiDoc(
-     *       parameters={
-     *          {"name"="username", "dataType"="string", "required"=true, "description"="username"}
-     *       }
-     * )
+     * @ApiDoc()
      * @return array
      */
-    public function getSaltAction(Request $request)
+    public function getSaltAction($username)
     {
         $user = $this
             ->getDoctrine()
             ->getRepository('WallabagCoreBundle:User')
-            ->findOneByUsername($request->query->get('username'));
+            ->findOneByUsername($username);
 
         if (is_null($user)) {
             throw $this->createNotFoundException();
@@ -250,7 +247,7 @@ class WallabagRestController extends Controller
 
         $json = $this->get('serializer')->serialize($entry->getTags(), 'json');
 
-        return new JsonResponse($json, 200);
+        return new Response($json, 200, array('application/json'));
     }
 
     /**