mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-19 00:11:29 +00:00
Fixed saving authors and systems to brews
This commit is contained in:
@@ -63,6 +63,10 @@ router.put('/api/update/:id', (req, res)=>{
|
||||
brew = _.merge(brew, req.body);
|
||||
brew.updatedAt = new Date();
|
||||
if(req.account) brew.authors = _.uniq(_.concat(brew.authors, req.account.username));
|
||||
|
||||
brew.markModified('authors');
|
||||
brew.markModified('systems');
|
||||
|
||||
brew.save((err, obj)=>{
|
||||
if(err) throw err;
|
||||
return res.status(200).send(obj);
|
||||
|
||||
Reference in New Issue
Block a user