diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-13 22:48:54 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-13 22:48:54 +0200 |
commit | f333f6b38f985c40247f7c82dd462f3016611dfe (patch) | |
tree | 80d7b1eed242e46af01cba658313703428ccb699 /controller | |
parent | b9de58c0c9da63f6a489df416df1819a40cb507d (diff) |
fix js tests
Diffstat (limited to 'controller')
-rw-r--r-- | controller/itemapicontroller.php | 18 | ||||
-rw-r--r-- | controller/itemcontroller.php | 18 |
2 files changed, 13 insertions, 23 deletions
diff --git a/controller/itemapicontroller.php b/controller/itemapicontroller.php index 8cd8b5578..5ab728d55 100644 --- a/controller/itemapicontroller.php +++ b/controller/itemapicontroller.php @@ -82,15 +82,6 @@ class ItemApiController extends ApiController { } - private function setStarred($isStarred, $feedId, $guidHash) { - try { - $this->itemBusinessLayer->star($feedId, $guidHash, $isStarred, $this->userId); - } catch(BusinessLayerException $ex){ - return $this->error($ex, Http::STATUS_NOT_FOUND); - } - } - - /** * @NoAdminRequired * @NoCSRFRequired @@ -115,6 +106,15 @@ class ItemApiController extends ApiController { } + private function setStarred($isStarred, $feedId, $guidHash) { + try { + $this->itemBusinessLayer->star($feedId, $guidHash, $isStarred, $this->userId); + } catch(BusinessLayerException $ex){ + return $this->error($ex, Http::STATUS_NOT_FOUND); + } + } + + /** * @NoAdminRequired * @NoCSRFRequired diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php index 3313f583b..67efb4b85 100644 --- a/controller/itemcontroller.php +++ b/controller/itemcontroller.php @@ -116,11 +116,6 @@ class ItemController extends Controller { } - private function setStarred($isStarred, $feedId, $guidHash){ - $this->itemBusinessLayer->star($feedId, $guidHash, $isStarred, $this->userId); - } - - /** * @NoAdminRequired * @@ -129,7 +124,7 @@ class ItemController extends Controller { */ public function star($feedId, $guidHash){ try { - $this->setStarred(true, $feedId, $guidHash); + $this->itemBusinessLayer->star($feedId, $guidHash, true, $this->userId); } catch(BusinessLayerException $ex) { return $this->error($ex, Http::STATUS_NOT_FOUND); } @@ -144,18 +139,13 @@ class ItemController extends Controller { */ public function unstar($feedId, $guidHash){ try { - $this->setStarred(false, $feedId, $guidHash); + $this->itemBusinessLayer->star($feedId, $guidHash, false, $this->userId); } catch(BusinessLayerException $ex) { return $this->error($ex, Http::STATUS_NOT_FOUND); } } - private function setRead($isRead, $itemId){ - $this->itemBusinessLayer->read($itemId, $isRead, $this->userId); - } - - /** * @NoAdminRequired * @@ -163,7 +153,7 @@ class ItemController extends Controller { */ public function read($itemId){ try { - $this->setRead(true); + $this->itemBusinessLayer->read($itemId, true, $this->userId); } catch(BusinessLayerException $ex) { return $this->error($ex, Http::STATUS_NOT_FOUND); } @@ -177,7 +167,7 @@ class ItemController extends Controller { */ public function unread($itemId){ try { - $this->setRead(false); + $this->itemBusinessLayer->read($itemId, false, $this->userId); } catch(BusinessLayerException $ex) { return $this->error($ex, Http::STATUS_NOT_FOUND); } |