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

@@ -33,6 +33,10 @@ async function getBranch(branchId) {
return await getEntity("SELECT * FROM branches WHERE branchId = ?", [branchId]);
}
async function getImage(imageId) {
return await getEntity("SELECT * FROM images WHERE imageId = ?", [imageId]);
}
async function updateEntity(entity) {
if (entity.beforeSaving) {
entity.beforeSaving();
@@ -54,6 +58,7 @@ module.exports = {
getEntity,
getNote,
getBranch,
getImage,
updateEntity,
setEntityConstructor
};