mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-11 08:46:30 +00:00
lint
This commit is contained in:
@@ -27,7 +27,7 @@ const Admin = createClass({
|
||||
<hr />
|
||||
<BrewCleanup />
|
||||
</div>
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ const BrewCleanup = createClass({
|
||||
request.get('/admin/cleanup')
|
||||
.then((res)=>this.setState({ count: res.body.count, primed: true }))
|
||||
.catch((err)=>this.setState({ error: err }))
|
||||
.finally(()=>this.setState({ pending : false }))
|
||||
.finally(()=>this.setState({ pending: false }));
|
||||
},
|
||||
cleanup(){
|
||||
this.setState({ pending: true });
|
||||
@@ -33,13 +33,13 @@ const BrewCleanup = createClass({
|
||||
request.post('/admin/cleanup')
|
||||
.then((res)=>this.setState({ count: res.body.count }))
|
||||
.catch((err)=>this.setState({ error: err }))
|
||||
.finally(()=>this.setState({ pending : false, primed : false }))
|
||||
.finally(()=>this.setState({ pending: false, primed: false }));
|
||||
},
|
||||
renderPrimed(){
|
||||
if(!this.state.primed) return;
|
||||
|
||||
if(!this.state.count){
|
||||
return <div className='removeBox'>No Matching Brews found.</div>
|
||||
return <div className='removeBox'>No Matching Brews found.</div>;
|
||||
}
|
||||
return <div className='removeBox'>
|
||||
<button onClick={this.cleanup} className='remove'>
|
||||
@@ -49,7 +49,7 @@ const BrewCleanup = createClass({
|
||||
}
|
||||
</button>
|
||||
<span>Found {this.state.count} Brews that could be removed. </span>
|
||||
</div>
|
||||
</div>;
|
||||
},
|
||||
render(){
|
||||
return <div className='BrewCleanup'>
|
||||
|
||||
@@ -27,7 +27,7 @@ const BrewLookup = createClass({
|
||||
request.get(`/admin/lookup/${this.state.query}`)
|
||||
.then((res)=>this.setState({ foundBrew: res.body }))
|
||||
.catch((err)=>this.setState({ error: err }))
|
||||
.finally(()=>this.setState({ searching : false }))
|
||||
.finally(()=>this.setState({ searching: false }));
|
||||
},
|
||||
|
||||
renderFoundBrew(){
|
||||
|
||||
@@ -16,13 +16,13 @@ const Stats = createClass({
|
||||
totalBrews : 0
|
||||
},
|
||||
fetching : false
|
||||
}
|
||||
};
|
||||
},
|
||||
componentDidMount(){
|
||||
this.fetchStats();
|
||||
},
|
||||
fetchStats(){
|
||||
this.setState({ fetching : true})
|
||||
this.setState({ fetching: true });
|
||||
request.get('/admin/stats')
|
||||
.then((res)=>this.setState({ stats: res.body }))
|
||||
.finally(()=>this.setState({ fetching: false }));
|
||||
|
||||
@@ -45,7 +45,7 @@ router.post('/admin/cleanup', mw.adminOnly, (req, res)=>{
|
||||
if(err) return res.status(500).send(err);
|
||||
return res.json({ count: objs.length });
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
/* Searches for matching edit or share id, also attempts to partial match */
|
||||
router.get('/admin/lookup/:id', mw.adminOnly, (req, res, next)=>{
|
||||
@@ -61,8 +61,8 @@ router.get('/admin/stats', mw.adminOnly, (req, res)=>{
|
||||
HomebrewModel.count({}, (err, count)=>{
|
||||
return res.json({
|
||||
totalBrews : count
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/admin', mw.adminOnly, (req, res)=>{
|
||||
@@ -70,7 +70,7 @@ router.get('/admin', mw.adminOnly, (req, res)=>{
|
||||
url : req.originalUrl
|
||||
})
|
||||
.then((page)=>res.send(page))
|
||||
.catch((err)=>res.sendStatus(500))
|
||||
.catch((err)=>res.sendStatus(500));
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user