diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-02-24 11:31:31 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-02-24 11:31:31 +0100 |
commit | ca9a83ee511a1e9c54d375b76509de699bd2164a (patch) | |
tree | cc337f2cafc054a323ee98f17651eff42851d80e /src/Wallabag | |
parent | abba55cdd653a1915147e8303b873cc0d1e63adc (diff) | |
download | wallabag-ca9a83ee511a1e9c54d375b76509de699bd2164a.tar.gz wallabag-ca9a83ee511a1e9c54d375b76509de699bd2164a.tar.zst wallabag-ca9a83ee511a1e9c54d375b76509de699bd2164a.zip |
return id of article instead of true if entry exists
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/EntryRestController.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 2c2ec0c1..af5f7603 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -41,7 +41,7 @@ class EntryRestController extends WallabagRestController | |||
41 | ->getRepository('WallabagCoreBundle:Entry') | 41 | ->getRepository('WallabagCoreBundle:Entry') |
42 | ->findByUrlAndUserId($url, $this->getUser()->getId()); | 42 | ->findByUrlAndUserId($url, $this->getUser()->getId()); |
43 | 43 | ||
44 | $results[$url] = false === $res ? false : true; | 44 | $results[$url] = $res instanceof Entry ? $res->getId() : false; |
45 | } | 45 | } |
46 | 46 | ||
47 | $json = $this->get('serializer')->serialize($results, 'json'); | 47 | $json = $this->get('serializer')->serialize($results, 'json'); |
@@ -60,7 +60,7 @@ class EntryRestController extends WallabagRestController | |||
60 | ->getRepository('WallabagCoreBundle:Entry') | 60 | ->getRepository('WallabagCoreBundle:Entry') |
61 | ->findByUrlAndUserId($url, $this->getUser()->getId()); | 61 | ->findByUrlAndUserId($url, $this->getUser()->getId()); |
62 | 62 | ||
63 | $exists = false === $res ? false : true; | 63 | $exists = $res instanceof Entry ? $res->getId() : false; |
64 | 64 | ||
65 | $json = $this->get('serializer')->serialize(['exists' => $exists], 'json'); | 65 | $json = $this->get('serializer')->serialize(['exists' => $exists], 'json'); |
66 | 66 | ||