mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-25 00:50:29 +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();
|
$this->validateAuthentication();
|
||||||
|
|
||||||
$isArchived = (int) $request->query->get('archive');
|
$isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
|
||||||
$isStarred = (int) $request->query->get('starred');
|
$isStarred = (null === $request->query->get('starred')) ? null : (bool) $request->query->get('starred');
|
||||||
$sort = $request->query->get('sort', 'created');
|
$sort = $request->query->get('sort', 'created');
|
||||||
$order = $request->query->get('order', 'desc');
|
$order = $request->query->get('order', 'desc');
|
||||||
$page = (int) $request->query->get('page', 1);
|
$page = (int) $request->query->get('page', 1);
|
||||||
|
@ -52,7 +52,7 @@ class WallabagRestController extends FOSRestController
|
||||||
|
|
||||||
$pager = $this->getDoctrine()
|
$pager = $this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->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->setCurrentPage($page);
|
||||||
$pager->setMaxPerPage($perPage);
|
$pager->setMaxPerPage($perPage);
|
||||||
|
|
Loading…
Reference in a new issue