copy changes to notes/edit.ts

This commit is contained in:
Hazelnoot 2025-04-01 10:55:56 -04:00
parent e37c2611f7
commit fffa6c97fe
2 changed files with 4 additions and 6 deletions

View file

@ -240,11 +240,11 @@ export class NoteEditService implements OnApplicationShutdown {
}); });
if (oldnote == null) { if (oldnote == null) {
throw new UnrecoverableError('edit failed: missing oldnote'); throw new UnrecoverableError(`edit failed for ${editid}: missing oldnote`);
} }
if (oldnote.userId !== user.id) { if (oldnote.userId !== user.id) {
throw new UnrecoverableError(`edit failed for ${oldnote.id}: user is not the note author`); throw new UnrecoverableError(`edit failed for ${editid}: user is not the note author`);
} }
// we never want to change the replyId, so fetch the original "parent" // we never want to change the replyId, so fetch the original "parent"

View file

@ -31,13 +31,11 @@ export const meta = {
res: { res: {
type: 'object', type: 'object',
optional: false, optional: false, nullable: false,
nullable: false,
properties: { properties: {
createdNote: { createdNote: {
type: 'object', type: 'object',
optional: false, optional: false, nullable: false,
nullable: false,
ref: 'Note', ref: 'Note',
}, },
}, },