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

@@ -29,6 +29,10 @@ async function getNote(noteId) {
return await getEntity("SELECT * FROM notes WHERE noteId = ?", [noteId]);
}
async function getBranch(branchId) {
return await getEntity("SELECT * FROM branches WHERE branchId = ?", [branchId]);
}
async function updateEntity(entity) {
if (entity.beforeSaving) {
entity.beforeSaving();
@@ -49,6 +53,7 @@ module.exports = {
getEntities,
getEntity,
getNote,
getBranch,
updateEntity,
setEntityConstructor
};