1
0
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:
Scott Tolksdorf
2017-01-19 12:06:14 -05:00
parent c417c1aa0c
commit 70346ffce7
4 changed files with 27 additions and 5 deletions

View File

@@ -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);