mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
refactoring of note creation APIs WIP
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user