mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-26 13:48:33 +02:00
Fix eslint complaining
This commit is contained in:
parent
5338b429e5
commit
ad3df75348
@ -22,11 +22,9 @@ module.exports = function (app, config) {
|
||||
type: eventType.featureRevived,
|
||||
createdBy: req.connection.remoteAddress,
|
||||
data: req.body,
|
||||
})).then(() => {
|
||||
res.status(200).end();
|
||||
}).catch(ValidationError, () => {
|
||||
res.status(400).json(req.validationErrors());
|
||||
})
|
||||
}))
|
||||
.then(() => res.status(200).end())
|
||||
.catch(ValidationError, () => res.status(400).json(req.validationErrors()))
|
||||
.catch(err => {
|
||||
logger.error('Could not revive feature toggle', err);
|
||||
res.status(500).end();
|
||||
|
@ -45,7 +45,8 @@ module.exports = function (app, config) {
|
||||
.catch(NameExistsError, () => {
|
||||
res.status(403).json([{
|
||||
msg: `A feature named '${req.body.name}' already exists. It could be archived.`,
|
||||
}]).end();
|
||||
}])
|
||||
.end();
|
||||
})
|
||||
.catch(ValidationError, () => {
|
||||
res.status(400).json(req.validationErrors());
|
||||
|
@ -64,15 +64,13 @@ module.exports = function (app, config) {
|
||||
createdBy: extractUser(req),
|
||||
data: newStrategy,
|
||||
}))
|
||||
.then(() => {
|
||||
res.status(201).end();
|
||||
})
|
||||
.then(() => res.status(201).end())
|
||||
.catch(NameExistsError, () => {
|
||||
res.status(403).json([{ msg: `A strategy named '${req.body.name}' already exists.` }]).end();
|
||||
})
|
||||
.catch(ValidationError, () => {
|
||||
res.status(400).json(req.validationErrors());
|
||||
res.status(403)
|
||||
.json([{ msg: `A strategy named '${req.body.name}' already exists.` }])
|
||||
.end();
|
||||
})
|
||||
.catch(ValidationError, () => res.status(400).json(req.validationErrors()))
|
||||
.catch(err => {
|
||||
logger.error('Could not create strategy', err);
|
||||
res.status(500).end();
|
||||
|
@ -2,10 +2,11 @@
|
||||
function getDatabaseUri () {
|
||||
if (!process.env.TEST_DATABASE_URL) {
|
||||
throw new Error('please set TEST_DATABASE_URL');
|
||||
} else {
|
||||
}
|
||||
|
||||
return process.env.TEST_DATABASE_URL;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getDatabaseUri,
|
||||
};
|
||||
|
@ -14,7 +14,8 @@ const LogEntryList = React.createClass({
|
||||
},
|
||||
|
||||
render () {
|
||||
const logEntryNodes = this.props.events.map(event => <LogEntry event={event} key={event.id} showFullEvents={this.state.showFullEvents} />);
|
||||
const logEntryNodes = this.props.events.map(event =>
|
||||
<LogEntry event={event} key={event.id} showFullEvents={this.state.showFullEvents} />);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
@ -8,7 +8,8 @@ const StrategyList = React.createClass({
|
||||
},
|
||||
|
||||
render () {
|
||||
const strategyNodes = this.props.strategies.map(strategy => <Strategy strategy={strategy} key={strategy.name} onRemove={this.props.onRemove} />);
|
||||
const strategyNodes = this.props.strategies.map(strategy =>
|
||||
<Strategy strategy={strategy} key={strategy.name} onRemove={this.props.onRemove} />);
|
||||
return (
|
||||
<div>{strategyNodes}</div>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user