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);
if(!$note || $note->isDeleted())
$reject("Note is gone");
$reject(83, "Note is gone");
$noteOwner = $note->getOwner();
assert($noteOwner instanceof 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([
"title" => $note->getName(),
@ -38,4 +38,4 @@ class Notes implements Handler
],
]);
}
}
}