mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
continuing in API review
This commit is contained in:
@@ -18,13 +18,13 @@ class Label extends Entity {
|
||||
this.labelId = utils.newLabelId();
|
||||
}
|
||||
|
||||
if (this.value) {
|
||||
if (!this.value) {
|
||||
// null value isn't allowed
|
||||
this.value = "";
|
||||
}
|
||||
|
||||
if (this.position === undefined) {
|
||||
this.position = 1 + await sql.getValue(`SELECT COALESCE(MAX(position), 0) FROM labels WHERE noteId = ?`, [noteId]);
|
||||
this.position = 1 + await sql.getValue(`SELECT COALESCE(MAX(position), 0) FROM labels WHERE noteId = ?`, [this.noteId]);
|
||||
}
|
||||
|
||||
if (!this.isDeleted) {
|
||||
|
||||
Reference in New Issue
Block a user