Merge pull request #1895 from wallabag/v2-fix-entries-api

All the entries are fetched via GET /api/entries
This commit is contained in:
Jeremy Benoist 2016-04-10 15:37:05 +02:00
commit f642863ff2

View file

@ -43,8 +43,8 @@ class WallabagRestController extends FOSRestController
{
$this->validateAuthentication();
$isArchived = (int) $request->query->get('archive');
$isStarred = (int) $request->query->get('starred');
$isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
$isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred');
$sort = $request->query->get('sort', 'created');
$order = $request->query->get('order', 'desc');
$page = (int) $request->query->get('page', 1);
@ -52,7 +52,7 @@ class WallabagRestController extends FOSRestController
$pager = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->findEntries($this->getUser()->getId(), (bool) $isArchived, (bool) $isStarred, $sort, $order);
->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order);
$pager->setCurrentPage($page);
$pager->setMaxPerPage($perPage);