aboutsummaryrefslogtreecommitdiffstats
path: root/apps/comments/lib
diff options
context:
space:
mode:
authorjld3103 <jld3103yt@gmail.com>2023-06-29 07:48:16 +0200
committerjld3103 <jld3103yt@gmail.com>2023-07-10 09:20:14 +0200
commit58746575dceabd0e7f19fae5ab862203a9bb4df2 (patch)
tree931dc185d6e11ec779d5e4e6b197cde3853665d5 /apps/comments/lib
parent3fb8aad35bcaff25df7fbd521d4f7fd1f15fdf9e (diff)
downloadnextcloud-server-58746575dceabd0e7f19fae5ab862203a9bb4df2.tar.gz
nextcloud-server-58746575dceabd0e7f19fae5ab862203a9bb4df2.zip
comments: Add OpenAPI spec
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'apps/comments/lib')
-rw-r--r--apps/comments/lib/Capabilities.php3
-rw-r--r--apps/comments/lib/Controller/NotificationsController.php15
2 files changed, 14 insertions, 4 deletions
diff --git a/apps/comments/lib/Capabilities.php b/apps/comments/lib/Capabilities.php
index ba5d2a2086b..597f248412c 100644
--- a/apps/comments/lib/Capabilities.php
+++ b/apps/comments/lib/Capabilities.php
@@ -28,6 +28,9 @@ namespace OCA\Comments;
use OCP\Capabilities\ICapability;
class Capabilities implements ICapability {
+ /**
+ * @return array{files: array{comments: bool}}
+ */
public function getCapabilities(): array {
return [
'files' => [
diff --git a/apps/comments/lib/Controller/NotificationsController.php b/apps/comments/lib/Controller/NotificationsController.php
index 41a9541a684..0186f8bc736 100644
--- a/apps/comments/lib/Controller/NotificationsController.php
+++ b/apps/comments/lib/Controller/NotificationsController.php
@@ -27,7 +27,7 @@ namespace OCA\Comments\Controller;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\NotFoundResponse;
use OCP\AppFramework\Http\RedirectResponse;
-use OCP\AppFramework\Http\Response;
+use OCP\AppFramework\Http;
use OCP\Comments\IComment;
use OCP\Comments\ICommentsManager;
use OCP\Files\IRootFolder;
@@ -38,8 +38,6 @@ use OCP\IUserSession;
use OCP\Notification\IManager;
/**
- * Class NotificationsController
- *
* @package OCA\Comments\Controller
*/
class NotificationsController extends Controller {
@@ -73,8 +71,17 @@ class NotificationsController extends Controller {
/**
* @PublicPage
* @NoCSRFRequired
+ *
+ * View a notification
+ *
+ * @param string $id ID of the notification
+ *
+ * @return RedirectResponse<Http::STATUS_SEE_OTHER, array{}>|NotFoundResponse<Http::STATUS_NOT_FOUND, array{}>
+ *
+ * 303: Redirected to notification
+ * 404: Notification not found
*/
- public function view(string $id): Response {
+ public function view(string $id): RedirectResponse|NotFoundResponse {
$currentUser = $this->userSession->getUser();
if (!$currentUser instanceof IUser) {
return new RedirectResponse(