From a3a2bc0a74e860664b0114a1080a0ebcb4297306 Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 11 Nov 2020 22:44:13 +0100 Subject: [PATCH] fix "reviving" deleted attributes, closes #1404 --- package-lock.json | 2 +- src/routes/api/attributes.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index ef978b211..ff20c3e3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "trilium", - "version": "0.45.2", + "version": "0.45.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/routes/api/attributes.js b/src/routes/api/attributes.js index 64ebc53de..8de30e9c4 100644 --- a/src/routes/api/attributes.js +++ b/src/routes/api/attributes.js @@ -52,8 +52,9 @@ function updateNoteAttribute(req) { attribute.type = body.type; } - if (body.value.trim()) { + if (body.type !== 'relation' || body.value.trim()) { attribute.value = body.value; + attribute.isDeleted = false; } else { // relations should never have empty target