summaryrefslogtreecommitdiffstats
path: root/lib/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Controller')
-rw-r--r--lib/Controller/ItemController.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Controller/ItemController.php b/lib/Controller/ItemController.php
index 757f2f115..7eeaa26ed 100644
--- a/lib/Controller/ItemController.php
+++ b/lib/Controller/ItemController.php
@@ -311,21 +311,22 @@ class ItemController extends Controller
/**
* @NoAdminRequired
*
- * @param int $itemId
- * @param string $shareWithId
- * @return array
+ * @param int $itemId Item to share
+ * @param string $shareWithId User to share with
*/
public function share($itemId, $shareWithId)
{
try {
- $exists = $this->itemService->checkSharing($itemId, $shareWithId, $this->userId);
-
- if($exists==0){
- $this->itemService->shareItem($itemId, $shareWithId, $this->userId);
- }
+ $this->itemService->share(
+ $this->getUserId(),
+ $itemId,
+ $shareWithId
+ );
} catch (ServiceNotFoundException $ex) {
return $this->error($ex, Http::STATUS_NOT_FOUND);
}
+
+ return [];
}
}