redesign of createNote APIs, WIP

This commit is contained in:
zadam
2019-11-14 23:10:56 +01:00
parent e143becb7a
commit de02e9e889
3 changed files with 131 additions and 83 deletions

View File

@@ -79,6 +79,10 @@ class Attribute extends Entity {
async beforeSaving() {
if (!this.value) {
if (this.type === 'relation') {
throw new Error(`Cannot save relation ${this.name} since it does not target any note.`);
}
// null value isn't allowed
this.value = "";
}