mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-01 00:08:27 +01:00
minor cleanup
This commit is contained in:
parent
c32f29e66b
commit
69e2827d9a
@ -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);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user