mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-13 06:32:39 +00:00
Removing invalid brews is working
This commit is contained in:
@@ -30,15 +30,12 @@ router.post('/api/brew', (req, res, next)=>{
|
||||
|
||||
//Update
|
||||
router.put('/api/brew/:editId', mw.loadBrew, (req, res, next)=>{
|
||||
console.log(req.account);
|
||||
const brew = req.body || {};
|
||||
if(req.account){
|
||||
brew.authors = _.uniq(_.concat(brew.authors, req.account.username));
|
||||
}
|
||||
console.log(brew);
|
||||
BrewData.update(req.params.editId, brew)
|
||||
.then((brew) => {
|
||||
console.log(brew.toJSON());
|
||||
return res.json(brew.toJSON());
|
||||
})
|
||||
.catch(next);
|
||||
|
||||
Reference in New Issue
Block a user