forked from wallabag/wallabag
Merge pull request #1069 from wallabag/v2-fix-return-entries
GET /api/entries returns object, no more array
This commit is contained in:
@ -68,7 +68,7 @@ class WallabagRestController extends Controller
|
|||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository('WallabagCoreBundle:Entry')
|
||||||
->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $isDeleted, $sort, $order);
|
->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $isDeleted, $sort, $order);
|
||||||
|
|
||||||
if (!is_array($entries)) {
|
if (!($entries)) {
|
||||||
throw $this->createNotFoundException();
|
throw $this->createNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -98,7 +98,7 @@ class EntryRepository extends EntityRepository
|
|||||||
* @param string $sort
|
* @param string $sort
|
||||||
* @param string $order
|
* @param string $order
|
||||||
*
|
*
|
||||||
* @return ArrayCollection
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function findEntries($userId, $isArchived = null, $isStarred = null, $isDeleted = null, $sort = 'created', $order = 'ASC')
|
public function findEntries($userId, $isArchived = null, $isStarred = null, $isDeleted = null, $sort = 'created', $order = 'ASC')
|
||||||
{
|
{
|
||||||
@ -126,6 +126,6 @@ class EntryRepository extends EntityRepository
|
|||||||
|
|
||||||
return $qb
|
return $qb
|
||||||
->getQuery()
|
->getQuery()
|
||||||
->getResult(Query::HYDRATE_ARRAY);
|
->getResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user