Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix updating non-text notes
zadam4d5612e845e3
diff --git a/src/routes/api/notes.js b/src/routes/api/notes.jsindex 4a67d11126..5ea556eba7 100644--- a/src/routes/api/notes.js+++ b/src/routes/api/notes.js@@ -55,10 +55,10 @@ function createNote(req) {}function updateNoteData(req) {- const {content, attachments} = req.body;+ const {content} = req.body;const {noteId} = req.params;- return noteService.updateNoteData(noteId, content, attachments);+ return noteService.updateNoteData(noteId, content);}function deleteNote(req) {diff --git a/src/services/notes.js b/src/services/notes.jsindex 237a7bbf33..6fe949115e 100644--- a/src/services/notes.js+++ b/src/services/notes.js@@ -575,12 +575,12 @@ function downloadImages(noteId, content) {}function saveLinks(note, content) {- if (note.type !== 'text' && note.type !== 'relationMap') {- return content;- }-- if (note.isProtected && !protectedSessionService.isProtectedSessionAvailable()) {- return content;+ if ((note.type !== 'text' && note.type !== 'relationMap')+ || (note.isProtected && !protectedSessionService.isProtectedSessionAvailable())) {+ return {+ forceFrontendReload: false,+ content+ };}const foundLinks = [];@@ -599,7 +599,7 @@ function saveLinks(note, content) {findRelationMapLinks(content, foundLinks);}else {- throw new Error(`Unrecognized type ${note.type}`);+ throw new Error(`Unrecognized type '${note.type}'`);}const existingLinks = note.getRelations().filter(rel =>