Fix incorrect rejection invocation in Notes.getNote

This commit is contained in:
celestora 2023-07-07 14:46:20 +03:00
parent c53dce2bea
commit 3a1acaeeeb

View file

@ -19,12 +19,12 @@ class Notes implements Handler
{ {
$note = $this->notes->get($noteId); $note = $this->notes->get($noteId);
if(!$note || $note->isDeleted()) if(!$note || $note->isDeleted())
$reject("Note is gone"); $reject(83, "Note is gone");
$noteOwner = $note->getOwner(); $noteOwner = $note->getOwner();
assert($noteOwner instanceof User); assert($noteOwner instanceof User);
if(!$noteOwner->getPrivacyPermission("notes.read", $this->user)) if(!$noteOwner->getPrivacyPermission("notes.read", $this->user))
$reject("You don't have permission to access this note"); $reject(160, "You don't have permission to access this note");
$resolve([ $resolve([
"title" => $note->getName(), "title" => $note->getName(),
@ -38,4 +38,4 @@ class Notes implements Handler
], ],
]); ]);
} }
} }