diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-05-09 12:57:35 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-05-09 12:57:35 +0200 |
commit | b8b4dfb4969e1baf84a14fb65a5dc153b0f5fae4 (patch) | |
tree | 27e211e26f442efd72a7f34903953ad57b1a9b76 /controller/itemcontroller.php | |
parent | fe0de2ab84a88cb4c742f4f10fd43716934b7282 (diff) |
only make one request for mark all read and mark folder read, fix #171, fix a bug that prevented readding of feeds when its folder was deleted, fix a bug that would not allow mark read for feeds when the app was started for the first time
Diffstat (limited to 'controller/itemcontroller.php')
-rw-r--r-- | controller/itemcontroller.php | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php index d19707f90..698c7a093 100644 --- a/controller/itemcontroller.php +++ b/controller/itemcontroller.php @@ -40,8 +40,8 @@ class ItemController extends Controller { private $feedBusinessLayer; public function __construct(API $api, Request $request, - ItemBusinessLayer $itemBusinessLayer, - FeedBusinessLayer $feedBusinessLayer){ + FeedBusinessLayer $feedBusinessLayer, + ItemBusinessLayer $itemBusinessLayer){ parent::__construct($api, $request); $this->itemBusinessLayer = $itemBusinessLayer; $this->feedBusinessLayer = $feedBusinessLayer; @@ -171,20 +171,14 @@ class ItemController extends Controller { * @IsSubAdminExemption * @Ajax */ - public function readFeed(){ + public function readAll(){ $userId = $this->api->getUserId(); - $feedId = (int) $this->params('feedId'); $highestItemId = (int) $this->params('highestItemId'); - $this->itemBusinessLayer->readFeed($feedId, $highestItemId, $userId); + $this->itemBusinessLayer->readAll($highestItemId, $userId); $params = array( - 'feeds' => array( - array( - 'id' => $feedId, - 'unreadCount' => 0 - ) - ) + 'feeds' => $this->feedBusinessLayer->findAll($userId) ); return $this->renderJSON($params); } |