diff options
author | Marco Nassabain <marco.nassabain@hotmail.com> | 2021-02-07 21:04:40 +0100 |
---|---|---|
committer | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2021-04-08 22:31:21 +0200 |
commit | 54aa8b527099edb409099335638382dbf754f36b (patch) | |
tree | 696b9a76c35421bd0d80a42ca13fbe25c4bda489 /lib/Controller | |
parent | ec5ae1a90a97816ac295bdf5f30db4ffe57b239d (diff) |
🩹 Return starredCount in newItems response params
- returning sharedCount everywhere where starredCount is returned
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r-- | lib/Controller/ItemController.php | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/lib/Controller/ItemController.php b/lib/Controller/ItemController.php index 9c83b4dfc..757f2f115 100644 --- a/lib/Controller/ItemController.php +++ b/lib/Controller/ItemController.php @@ -204,36 +204,20 @@ class ItemController extends Controller $return = []; try { - switch ($type) { - case ListType::FEED: - $items = $this->itemService->findAllInFeedAfter( - $this->getUserId(), - $id, - $lastModified, - !$showAll - ); - break; - case ListType::FOLDER: - $items = $this->itemService->findAllInFolderAfter( - $this->getUserId(), - $id, - $lastModified, - !$showAll - ); - break; - default: - $items = $this->itemService->findAllAfter( - $this->getUserId(), - $type, - $lastModified - ); - break; - } - - $return['newestItemId'] = $this->itemService->newest($this->getUserId())->getId(); - $return['feeds'] = $this->feedService->findAllForUser($this->getUserId()); - $return['starred'] = count($this->itemService->starred($this->getUserId())); - $return['items'] = $items; + $params['newestItemId'] = + $this->itemService->getNewestItemId($this->userId); + $params['feeds'] = $this->feedService->findAllForUser($this->userId); + $params['starred'] = + $this->itemService->starredCount($this->userId); + $params['shared'] = + $this->itemService->sharedCount($this->userId); + $params['items'] = $this->itemService->findAllNew( + $id, + $type, + $lastModified, + $showAll, + $this->userId + ); // this gets thrown if there are no items // in that case just return an empty array |