summaryrefslogtreecommitdiffstats
path: root/lib/Controller
diff options
context:
space:
mode:
authorMarco Nassabain <marco.nassabain@etu.unistra.fr>2021-01-17 19:51:17 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-08 22:31:21 +0200
commit08171bb42de718cda797462b9f5de029ce82afb9 (patch)
treedc3b803582792b687d5454a412073cdff3eab652 /lib/Controller
parent527eef0727e3bfceb53f209bc74d096626eb1a6b (diff)
✨ NewsItem: add share routes + controller func
Signed-off-by: Marco Nassabain <marco.nassabain@hotmail.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r--lib/Controller/ItemController.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Controller/ItemController.php b/lib/Controller/ItemController.php
index 85f67ef7a..57ad318d2 100644
--- a/lib/Controller/ItemController.php
+++ b/lib/Controller/ItemController.php
@@ -318,4 +318,24 @@ class ItemController extends Controller
}
}
}
+
+
+ /**
+ * @NoAdminRequired
+ *
+ * @param int $itemId
+ * @param string $shareWithId
+ * @return array
+ */
+ public function share($itemId, $shareWithId)
+ {
+ try {
+ $this->itemService->shareItem($itemId, $shareWithId, $this->userId);
+ } catch (ServiceNotFoundException $ex) {
+ return $this->error($ex, Http::STATUS_NOT_FOUND);
+ }
+
+ return [];
+ }
+
}