date notes are now created with template relations

This commit is contained in:
zadam
2019-09-07 21:40:18 +02:00
parent 3bf8546d51
commit 45ee959c11
4 changed files with 39 additions and 3 deletions

View File

@@ -72,6 +72,15 @@ async function createLabel(noteId, name, value = "") {
});
}
async function createRelation(noteId, name, targetNoteId) {
return await createAttribute({
noteId: noteId,
type: 'relation',
name: name,
value: targetNoteId
});
}
async function createAttribute(attribute) {
return await new Attribute(attribute).save();
}
@@ -114,6 +123,7 @@ module.exports = {
getNotesWithLabels,
getNoteWithLabel,
createLabel,
createRelation,
createAttribute,
getAttributeNames,
isAttributeType,