mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-22 17:18:37 +00:00
return id of article instead of true if entry exists
This commit is contained in:
parent
abba55cdd6
commit
ca9a83ee51
2 changed files with 4 additions and 4 deletions
|
@ -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');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue