fix initializing new attribute in becca

This commit is contained in:
zadam 2021-09-29 13:33:05 +02:00
parent d975acc99a
commit 37c30bf88a

View File

@ -80,9 +80,10 @@ function setNoteAttribute(req) {
attr.value = body.value; attr.value = body.value;
attr.save(); attr.save();
} else { } else {
const attr = new Attribute(body); const params = {...body};
attr.noteId = noteId; params.noteId = noteId; // noteId must be set before calling constructor for proper initialization
attr.save();
new Attribute(params).save();
} }
} }