smaller refactorings continued

This commit is contained in:
azivner
2018-04-01 17:38:24 -04:00
parent 15d951b04e
commit 96dab5d51e
14 changed files with 122 additions and 109 deletions

View File

@@ -21,14 +21,11 @@ async function cloneNoteToParent(req) {
const newNotePos = maxNotePos === null ? 0 : maxNotePos + 1;
const branch = new Branch({
branchId: utils.newBranchId(),
noteId: childNoteId,
parentNoteId: parentNoteId,
prefix: prefix,
notePosition: newNotePos,
isExpanded: 0,
dateModified: utils.nowDate(),
isDeleted: 0
isExpanded: 0
});
await branch.save();
@@ -58,13 +55,10 @@ async function cloneNoteAfter(req) {
await sync_table.addNoteReorderingSync(afterNote.parentNoteId);
const branch = new Branch({
branchId: utils.newBranchId(),
noteId: noteId,
parentNoteId: afterNote.parentNoteId,
notePosition: afterNote.notePosition + 1,
isExpanded: 0,
dateModified: utils.nowDate(),
isDeleted: 0
isExpanded: 0
});
await branch.save();