expose note hoisting to frontend API, closes #663

This commit is contained in:
zadam
2019-10-21 21:22:53 +02:00
parent f0496cb42c
commit 132360b46b
6 changed files with 226 additions and 47 deletions

View File

@@ -70,7 +70,7 @@ class Branch extends Entity {
async 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;
this.notePosition = maxNotePos === null ? 0 : maxNotePos + 10;
}
if (!this.isDeleted) {