fixes in attribute persistence + WIP on display of promoted attrs

This commit is contained in:
azivner
2018-08-06 08:59:26 +02:00
parent 194ce4f10f
commit 2aab3ad281
16 changed files with 138 additions and 37 deletions

View File

@@ -16,8 +16,6 @@ class Branch extends Entity {
}
async beforeSaving() {
super.beforeSaving();
if (this.notePosition === undefined) {
const maxNotePos = await sql.getValue('SELECT MAX(notePosition) FROM branches WHERE parentNoteId = ? AND isDeleted = 0', [this.parentNoteId]);
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 1;
@@ -32,6 +30,8 @@ class Branch extends Entity {
}
this.dateModified = dateUtils.nowDate();
super.beforeSaving();
}
}