From b90ddcda033ce882ce41e06e721832e1a87844dc Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Fri, 19 Jul 2019 12:53:28 -0100 Subject: /local/v1/post?id=Signed-off-by: Maxence Lange --- lib/Controller/LocalController.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib') diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php index 69294bf8..9b91131c 100644 --- a/lib/Controller/LocalController.php +++ b/lib/Controller/LocalController.php @@ -182,6 +182,26 @@ class LocalController extends Controller { } + /** + * get info about a post (limited to viewer rights). + * + * @NoAdminRequired + * + * @param string $id + * + * @return DataResponse + */ + public function postData(string $id): DataResponse { + try { + $this->initViewer(true); + + return $this->directSuccess($this->noteService->getNoteById($id, true)); + } catch (Exception $e) { + return $this->fail($e); + } + } + + /** * Delete your own post. * -- cgit v1.2.3