smaller refactorings (mostly entitization)

This commit is contained in:
azivner
2018-04-01 11:05:09 -04:00
parent c9d73c6115
commit fad0ec757b
12 changed files with 69 additions and 56 deletions

View File

@@ -58,7 +58,7 @@ async function createNewNote(parentNoteId, noteOpts) {
mime: noteOpts.mime ? noteOpts.mime : 'text/html'
});
await repository.updateEntity(note);
await note.save();
const branch = new Branch({
branchId: utils.newBranchId(),
@@ -69,12 +69,13 @@ async function createNewNote(parentNoteId, noteOpts) {
isDeleted: 0
});
await repository.updateEntity(branch);
await branch.save();
return {
noteId: note.noteId,
note,
branchId: branch.branchId,
note
branch
};
}