refactoring of note creation APIs WIP

This commit is contained in:
zadam
2019-11-16 11:09:52 +01:00
parent de02e9e889
commit 13c0411533
13 changed files with 115 additions and 107 deletions

View File

@@ -475,7 +475,7 @@ class Note extends Entity {
/**
* @return {Promise<Attribute>}
*/
async createAttribute(type, name, value = "") {
async addAttribute(type, name, value = "") {
const attr = new Attribute({
noteId: this.noteId,
type: type,
@@ -490,12 +490,12 @@ class Note extends Entity {
return attr;
}
async createLabel(name, value = "") {
return await this.createAttribute(LABEL, name, value);
async addLabel(name, value = "") {
return await this.addAttribute(LABEL, name, value);
}
async createRelation(name, targetNoteId) {
return await this.createAttribute(RELATION, name, targetNoteId);
async addRelation(name, targetNoteId) {
return await this.addAttribute(RELATION, name, targetNoteId);
}
/**