From f333f6b38f985c40247f7c82dd462f3016611dfe Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Tue, 13 May 2014 22:48:54 +0200 Subject: fix js tests --- controller/itemapicontroller.php | 18 +++++++++--------- controller/itemcontroller.php | 18 ++++-------------- 2 files changed, 13 insertions(+), 23 deletions(-) (limited to 'controller') 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); } -- cgit v1.2.3