shortcuts improvements

This commit is contained in:
zadam
2022-11-26 14:57:39 +01:00
parent 6883b71ce7
commit 6a9ac6f90a
9 changed files with 97 additions and 23 deletions

View File

@@ -20,8 +20,12 @@ function updateNoteAttribute(req) {
if (body.attributeId) {
attribute = becca.getAttribute(body.attributeId);
if (!attribute) {
return [404, `Attribute '${body.attributeId}' does not exist.`];
}
if (attribute.noteId !== noteId) {
return [400, `Attribute ${body.attributeId} is not owned by ${noteId}`];
return [400, `Attribute '${body.attributeId}' is not owned by ${noteId}`];
}
if (body.type !== attribute.type