aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/ContactsMenuController.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/Controller/ContactsMenuController.php')
-rw-r--r--core/Controller/ContactsMenuController.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/Controller/ContactsMenuController.php b/core/Controller/ContactsMenuController.php
index b0e0e0c6a77..bbb990f1a4f 100644
--- a/core/Controller/ContactsMenuController.php
+++ b/core/Controller/ContactsMenuController.php
@@ -26,6 +26,7 @@ namespace OC\Core\Controller;
use OC\Contacts\ContactsMenu\Manager;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCP\IUserSession;
@@ -59,4 +60,20 @@ class ContactsMenuController extends Controller {
return $this->manager->getEntries($this->userSession->getUser(), $filter);
}
+ /**
+ * @NoAdminRequired
+ *
+ * @param integer $shareType
+ * @param string $shareWith
+ * @return JSONResponse
+ */
+ public function findOne($shareType, $shareWith) {
+ $contact = $this->manager->findOne($this->userSession->getUser(), $shareType, $shareWith);
+
+ if ($contact) {
+ return $contact;
+ } else {
+ return new JSONResponse([], Http::STATUS_NOT_FOUND);
+ }
+ }
}