]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ApiBundle/Controller/EntryRestController.php
return id of article instead of true if entry exists
[github/wallabag/wallabag.git] / src / Wallabag / ApiBundle / Controller / EntryRestController.php
index 2c2ec0c106ac1d72073649907f45a634ff7ad2ba..af5f760382bdbd729becb4c9dfb91cc7e4177649 100644 (file)
@@ -41,7 +41,7 @@ class EntryRestController extends WallabagRestController
                     ->getRepository('WallabagCoreBundle:Entry')
                     ->findByUrlAndUserId($url, $this->getUser()->getId());
 
-                $results[$url] = false === $res ? false : true;
+                $results[$url] = $res instanceof Entry ? $res->getId() : false;
             }
 
             $json = $this->get('serializer')->serialize($results, 'json');
@@ -60,7 +60,7 @@ class EntryRestController extends WallabagRestController
             ->getRepository('WallabagCoreBundle:Entry')
             ->findByUrlAndUserId($url, $this->getUser()->getId());
 
-        $exists = false === $res ? false : true;
+        $exists = $res instanceof Entry ? $res->getId() : false;
 
         $json = $this->get('serializer')->serialize(['exists' => $exists], 'json');