0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-07 12:02:44 +00:00
This commit is contained in:
Trevor Buckner
2020-01-05 23:59:42 -05:00
parent 3ea3d273a5
commit b289cb1003
2 changed files with 2 additions and 2 deletions

View File

@@ -50,8 +50,8 @@ router.put('/api/update/:id', (req, res)=>{
brew = _.merge(brew, req.body); brew = _.merge(brew, req.body);
brew.textBin = zlib.deflateSync(req.body.text); // Compress brew text to binary before saving brew.textBin = zlib.deflateSync(req.body.text); // Compress brew text to binary before saving
brew.text = ''; // Clear out the non-binary text field so its not saved twice brew.text = ''; // Clear out the non-binary text field so its not saved twice
brew.updatedAt = new Date(); brew.updatedAt = new Date();
if(req.account) brew.authors = _.uniq(_.concat(brew.authors, req.account.username)); if(req.account) brew.authors = _.uniq(_.concat(brew.authors, req.account.username));
brew.markModified('authors'); brew.markModified('authors');