From 409c8354336b0c96842da7ba6711468aa939d76e Mon Sep 17 00:00:00 2001 From: Marco Nassabain Date: Thu, 4 Mar 2021 00:16:19 +0100 Subject: =?UTF-8?q?=F0=9F=A9=B9=20Patch=20ItemController=20+=20test=20to?= =?UTF-8?q?=20use=20ShareService?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Nassabain --- lib/Controller/ItemController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Controller/ItemController.php b/lib/Controller/ItemController.php index 4a01fb23c..e3ef4b9e5 100644 --- a/lib/Controller/ItemController.php +++ b/lib/Controller/ItemController.php @@ -24,6 +24,7 @@ use \OCP\AppFramework\Http; use \OCA\News\Service\Exceptions\ServiceException; use \OCA\News\Service\Exceptions\ServiceNotFoundException; use \OCA\News\Service\ItemServiceV2; +use \OCA\News\Service\ShareService; use OCP\IUserSession; /** @@ -43,6 +44,10 @@ class ItemController extends Controller * @var FeedServiceV2 */ private $feedService; + /** + * @var ShareService + */ + private $shareService; /** * @var IConfig */ @@ -52,12 +57,14 @@ class ItemController extends Controller IRequest $request, FeedServiceV2 $feedService, ItemServiceV2 $itemService, + ShareService $shareService, IConfig $settings, ?IUserSession $userSession ) { parent::__construct($request, $userSession); $this->itemService = $itemService; $this->feedService = $feedService; + $this->shareService = $shareService; $this->settings = $settings; } @@ -329,7 +336,7 @@ class ItemController extends Controller public function share($itemId, $shareWithId) { try { - $this->itemService->share( + $this->shareService->share( $this->getUserId(), $itemId, $shareWithId -- cgit v1.2.3