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.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();
}
}