mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 07:32:40 +00:00
Lint
This commit is contained in:
@@ -68,13 +68,13 @@ router.get('/api/remove/:id', (req, res)=>{
|
|||||||
HomebrewModel.find({ editId: req.params.id }, (err, objs)=>{
|
HomebrewModel.find({ editId: req.params.id }, (err, objs)=>{
|
||||||
if(!objs.length || err) return res.status(404).send('Can not find homebrew with that id');
|
if(!objs.length || err) return res.status(404).send('Can not find homebrew with that id');
|
||||||
const brew = objs[0];
|
const brew = objs[0];
|
||||||
|
|
||||||
// Remove current user as author
|
// Remove current user as author
|
||||||
if(req.account){
|
if(req.account){
|
||||||
brew.authors = _.pull(brew.authors, req.account.username);
|
brew.authors = _.pull(brew.authors, req.account.username);
|
||||||
brew.markModified('authors');
|
brew.markModified('authors');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete brew if there are no authors left
|
// Delete brew if there are no authors left
|
||||||
if(!brew.authors.length)
|
if(!brew.authors.length)
|
||||||
brew.remove((err)=>{
|
brew.remove((err)=>{
|
||||||
|
|||||||
Reference in New Issue
Block a user