converted option operations to repository

This commit is contained in:
azivner
2018-05-22 00:22:43 -04:00
parent 49a53f7a45
commit cd45bcfd03
4 changed files with 30 additions and 13 deletions

View File

@@ -41,6 +41,10 @@ async function getLabel(labelId) {
return await getEntity("SELECT * FROM labels WHERE labelId = ?", [labelId]);
}
async function getOption(name) {
return await getEntity("SELECT * FROM options WHERE name = ?", [name]);
}
async function updateEntity(entity) {
if (entity.beforeSaving) {
await entity.beforeSaving();
@@ -66,6 +70,7 @@ module.exports = {
getBranch,
getImage,
getLabel,
getOption,
updateEntity,
setEntityConstructor
};