From 29713de6cd7ca4eb06686eb5ceeb2478eaa9d042 Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 22 Dec 2022 23:11:12 +0100 Subject: [PATCH] small fixes --- src/becca/entities/attribute.js | 2 -- src/routes/api/attributes.js | 4 +++- src/services/special_notes.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/becca/entities/attribute.js b/src/becca/entities/attribute.js index 045092583..bb209d3ec 100644 --- a/src/becca/entities/attribute.js +++ b/src/becca/entities/attribute.js @@ -63,8 +63,6 @@ class Attribute extends AbstractEntity { } init() { - this.validate(); - if (this.attributeId) { this.becca.attributes[this.attributeId] = this; } diff --git a/src/routes/api/attributes.js b/src/routes/api/attributes.js index ec4ab2c3f..54ef7a39f 100644 --- a/src/routes/api/attributes.js +++ b/src/routes/api/attributes.js @@ -49,7 +49,7 @@ function updateNoteAttribute(req) { } } else { - if (body.type === 'relation' && !body.value.trim()) { + if (body.type === 'relation' && !body.value?.trim()) { return {}; } @@ -68,6 +68,8 @@ function updateNoteAttribute(req) { attribute.markAsDeleted(); } + console.log(attribute); + attribute.save(); return { diff --git a/src/services/special_notes.js b/src/services/special_notes.js index e75a33621..dbf8937aa 100644 --- a/src/services/special_notes.js +++ b/src/services/special_notes.js @@ -209,7 +209,7 @@ function createLauncher({parentNoteId, launcherType, id}) { function resetLauncher(noteId) { const note = becca.getNote(noteId); - if (note.isLauncherConfig()) { + if (note.isLaunchBarConfig()) { if (note) { if (noteId === '_lbRoot') { // deleting hoisted notes are not allowed, so we just reset the children