mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 16:25:51 +01:00
fix saving note revisions, closes #2915
This commit is contained in:
@@ -21,7 +21,8 @@ function updateFile(req) {
|
||||
return [404, `Note ${noteId} doesn't exist.`];
|
||||
}
|
||||
|
||||
noteRevisionService.createNoteRevision(note);
|
||||
note.saveNoteRevision();
|
||||
noteRevisionService.protectNoteRevisions(note);
|
||||
|
||||
note.mime = file.mimetype.toLowerCase();
|
||||
note.save();
|
||||
|
||||
@@ -97,7 +97,8 @@ function restoreNoteRevision(req) {
|
||||
if (noteRevision) {
|
||||
const note = noteRevision.getNote();
|
||||
|
||||
noteRevisionService.createNoteRevision(note);
|
||||
note.saveNoteRevision();
|
||||
noteRevisionService.protectNoteRevisions(note);
|
||||
|
||||
note.title = noteRevision.title;
|
||||
note.setContent(noteRevision.getContent());
|
||||
|
||||
@@ -294,7 +294,8 @@ function uploadModifiedFile(req) {
|
||||
|
||||
log.info(`Updating note '${noteId}' with content from ${filePath}`);
|
||||
|
||||
noteRevisionService.createNoteRevision(note);
|
||||
note.saveNoteRevision();
|
||||
noteRevisionService.protectNoteRevisions(note);
|
||||
|
||||
const fileContent = fs.readFileSync(filePath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user