mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-24 00:20:28 +00:00
Merge pull request #1895 from wallabag/v2-fix-entries-api
All the entries are fetched via GET /api/entries
This commit is contained in:
commit
f642863ff2
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue