fix: #10868 incorrect text inserted to note_edit

Co-authored-by: Lhcfl <Lhcfl@outlook.com>
This commit is contained in:
Linca 2024-03-25 17:02:02 +00:00 committed by naskya
parent 17cd5ecfc2
commit 72d5e4cdb8
2 changed files with 5 additions and 5 deletions

View file

@ -296,7 +296,7 @@ export class Note {
nullable: true, nullable: true,
comment: "The updated date of the Note.", comment: "The updated date of the Note.",
}) })
public updatedAt: Date; public updatedAt: Date | null;
//#endregion //#endregion
constructor(data: Partial<Note>) { constructor(data: Partial<Note>) {

View file

@ -606,13 +606,13 @@ export default define(meta, paramDef, async (ps, user) => {
update.updatedAt = new Date(); update.updatedAt = new Date();
await Notes.update(note.id, update); await Notes.update(note.id, update);
// Add NoteEdit history // Add NoteEdit history for the previous one
await NoteEdits.insert({ await NoteEdits.insert({
id: genId(), id: genId(),
noteId: note.id, noteId: note.id,
text: ps.text || undefined, text: note.text || undefined,
cw: ps.cw, cw: note.cw,
fileIds: ps.fileIds, fileIds: note.fileIds,
updatedAt: new Date(), updatedAt: new Date(),
}); });