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 initializing new attribute in becca
zadam37c30bf88a07
diff --git a/src/routes/api/attributes.js b/src/routes/api/attributes.jsindex 9eb01ceb34..660ef2be43 100644--- a/src/routes/api/attributes.js+++ b/src/routes/api/attributes.js@@ -80,9 +80,10 @@ function setNoteAttribute(req) {attr.value = body.value;attr.save();} else {- const attr = new Attribute(body);- attr.noteId = noteId;- attr.save();+ const params = {...body};+ params.noteId = noteId; // noteId must be set before calling constructor for proper initialization++ new Attribute(params).save();}}