]> source.dussan.org Git - nextcloud-server.git/commitdiff
enh: serialize path
authorChristopher Ng <chrng8@gmail.com>
Mon, 31 Jul 2023 19:10:50 +0000 (12:10 -0700)
committerChristopher Ng <chrng8@gmail.com>
Tue, 8 Aug 2023 23:29:12 +0000 (16:29 -0700)
Signed-off-by: Christopher Ng <chrng8@gmail.com>
(cherry picked from commit db7f5a29f36cddb793ee813d21ebdc717dfbb0ae)

apps/files_reminders/lib/Model/RichReminder.php

index 1ac1baae370dbea162a8a578fac902254c84c7e9..10dc89799fe99d214ca1ab4e83be2da9736ebf6b 100644 (file)
@@ -45,8 +45,7 @@ class RichReminder extends Reminder implements JsonSerializable {
         * @throws NodeNotFoundException
         */
        public function getNode(): Node {
-               $userFolder = $this->root->getUserFolder($this->getUserId());
-               $nodes = $userFolder->getById($this->getFileId());
+               $nodes = $this->root->getUserFolder($this->getUserId())->getById($this->getFileId());
                if (empty($nodes)) {
                        throw new NodeNotFoundException();
                }
@@ -66,6 +65,7 @@ class RichReminder extends Reminder implements JsonSerializable {
                return [
                        'userId' => $this->getUserId(),
                        'fileId' => $this->getFileId(),
+                       'path' => $this->getNode()->getPath(),
                        'dueDate' => $this->getDueDate()->format(DateTimeInterface::ATOM), // ISO 8601
                        'updatedAt' => $this->getUpdatedAt()->format(DateTimeInterface::ATOM), // ISO 8601
                        'createdAt' => $this->getCreatedAt()->format(DateTimeInterface::ATOM), // ISO 8601