mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
copy changes to notes/edit.ts
This commit is contained in:
parent
e37c2611f7
commit
fffa6c97fe
2 changed files with 4 additions and 6 deletions
|
@ -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"
|
||||||
|
|
|
@ -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',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue