1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-01 00:08:27 +01:00

minor cleanup

This commit is contained in:
ivaosthu 2016-12-02 16:20:13 +01:00
parent c32f29e66b
commit 69e2827d9a
2 changed files with 5 additions and 15 deletions

View File

@ -66,36 +66,28 @@ class FeatureToggleStore {
_createFeature (data) { _createFeature (data) {
return this.db('features') return this.db('features')
.insert(this.eventDataToRow(data)) .insert(this.eventDataToRow(data))
.catch(err => { .catch(err => logger.error('Could not insert feature, error was: ', err));
logger.error('Could not insert feature, error was: ', err);
});
} }
_updateFeature (data) { _updateFeature (data) {
return this.db('features') return this.db('features')
.where({ name: data.name }) .where({ name: data.name })
.update(this.eventDataToRow(data)) .update(this.eventDataToRow(data))
.catch(err => { .catch(err => logger.error('Could not update feature, error was: ', err));
logger.error('Could not update feature, error was: ', err);
});
} }
_archiveFeature (data) { _archiveFeature (data) {
return this.db('features') return this.db('features')
.where({ name: data.name }) .where({ name: data.name })
.update({ archived: 1 }) .update({ archived: 1 })
.catch(err => { .catch(err => logger.error('Could not archive feature, error was: ', err));
logger.error('Could not archive feature, error was: ', err);
});
} }
_reviveFeature (data) { _reviveFeature (data) {
return this.db('features') return this.db('features')
.where({ name: data.name }) .where({ name: data.name })
.update({ archived: 0, enabled: 0 }) .update({ archived: 0, enabled: 0 })
.catch(err => { .catch(err => logger.error('Could not archive feature, error was: ', err));
logger.error('Could not archive feature, error was: ', err);
});
} }
}; };

View File

@ -59,9 +59,7 @@ class StrategyStore {
_createStrategy (data) { _createStrategy (data) {
this.db(TABLE) this.db(TABLE)
.insert(this.eventDataToRow(data)) .insert(this.eventDataToRow(data))
.catch(err => { .catch(err => logger.error('Could not insert strategy, error was: ', err));
logger.error('Could not insert strategy, error was: ', err);
});
} }
}; };