refactoring of note deletion

This commit is contained in:
azivner
2018-03-31 23:08:22 -04:00
parent 4f200c73dc
commit 12439d8761
9 changed files with 46 additions and 36 deletions

View File

@@ -5,6 +5,7 @@ const utils = require('../../services/utils');
const sync_table = require('../../services/sync_table');
const tree = require('../../services/tree');
const notes = require('../../services/notes');
const repository = require('../../services/repository');
/**
* Code in this file deals with moving and cloning note tree rows. Relationship between note and parent note is unique
@@ -101,7 +102,9 @@ async function setExpanded(req) {
}
async function deleteBranch(req) {
await notes.deleteNote(req.params.branchId);
const branch = await repository.getBranch(req.params.branchId);
await notes.deleteNote(branch);
}
module.exports = {