mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-27 03:21:01 +00:00
Entry: add sort parameter archived
This commit is contained in:
parent
7975395d10
commit
0e70e81227
2 changed files with 3 additions and 1 deletions
|
@ -79,7 +79,7 @@ class EntryRestController extends WallabagRestController
|
|||
* parameters={
|
||||
* {"name"="archive", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by archived status."},
|
||||
* {"name"="starred", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by starred status."},
|
||||
* {"name"="sort", "dataType"="string", "required"=false, "format"="'created' or 'updated', default 'created'", "description"="sort entries by date."},
|
||||
* {"name"="sort", "dataType"="string", "required"=false, "format"="'created' or 'updated' or 'archived', default 'created'", "description"="sort entries by date."},
|
||||
* {"name"="order", "dataType"="string", "required"=false, "format"="'asc' or 'desc', default 'desc'", "description"="order of sort."},
|
||||
* {"name"="page", "dataType"="integer", "required"=false, "format"="default '1'", "description"="what page you want."},
|
||||
* {"name"="perPage", "dataType"="integer", "required"=false, "format"="default'30'", "description"="results per page."},
|
||||
|
|
|
@ -189,6 +189,8 @@ class EntryRepository extends EntityRepository
|
|||
$qb->orderBy('e.id', $order);
|
||||
} elseif ('updated' === $sort) {
|
||||
$qb->orderBy('e.updatedAt', $order);
|
||||
} else if ('archived' === $sort) {
|
||||
$qb->orderBy('e.archivedAt', $order);
|
||||
}
|
||||
|
||||
$pagerAdapter = new DoctrineORMAdapter($qb, true, false);
|
||||
|
|
Loading…
Reference in a new issue