diff --git a/lib/Controller/MentionController.php b/lib/Controller/MentionController.php index 3e5496ef4d..441af7d15f 100644 --- a/lib/Controller/MentionController.php +++ b/lib/Controller/MentionController.php @@ -38,7 +38,7 @@ public function mention(int $fileId, string $mention): DataResponse { $userFolder = $this->rootFolder->getUserFolder($this->userId); $file = $userFolder->getFirstNodeById($fileId); if ($file === null) { - return new DataResponse([], Http::STATUS_NOT_FOUND); + return new DataResponse(['message' => 'File not found for current user'], Http::STATUS_NOT_FOUND); } // Reverse the array of users to pop off the first user later @@ -52,7 +52,7 @@ public function mention(int $fileId, string $mention): DataResponse { $userFolder = $this->rootFolder->getUserFolder($user->getUID()); $file = $userFolder->getFirstNodeById($fileId); if ($file === null) { - return new DataResponse([], Http::STATUS_NOT_FOUND); + return new DataResponse(['message' => 'File not found for mentioned user'], Http::STATUS_NOT_FOUND); } $notification = $this->manager->createNotification(); @@ -70,6 +70,6 @@ public function mention(int $fileId, string $mention): DataResponse { return new DataResponse([], Http::STATUS_OK); } - return new DataResponse([], Http::STATUS_NOT_FOUND); + return new DataResponse(['message' => 'Notification already present'], Http::STATUS_NOT_FOUND); } }