0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-03 01:52:42 +00:00

Revert "Merge pull request #867 from naturalcrit/compressBrews"

This reverts commit 94d090277f, reversing
changes made to aeffec1763.
This commit is contained in:
Trevor Buckner
2020-01-23 10:27:30 -05:00
parent 94d090277f
commit 4128670a9f
6 changed files with 5 additions and 125 deletions

View File

@@ -38,7 +38,7 @@ router.post('/api', (req, res)=>{
}
newHomebrew.textBin = zlib.deflateRawSync(newHomebrew.text); // Compress brew text to binary before saving
newHomebrew.text = undefined; // Delete the non-binary text field since it's not needed anymore
newHomebrew.text = ''; // Clear out the non-binary text field so its not saved twice
newHomebrew.save((err, obj)=>{
if(err){
@@ -53,8 +53,8 @@ router.put('/api/update/:id', (req, res)=>{
HomebrewModel.get({ editId: req.params.id })
.then((brew)=>{
brew = _.merge(brew, req.body);
brew.textBin = zlib.deflateRawSync(req.body.text); // Compress brew text to binary before saving
brew.text = undefined; // Clear out the non-binary text field so its not saved twice
brew.textBin = zlib.deflateRawSync(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.updatedAt = new Date();
if(req.account) brew.authors = _.uniq(_.concat(brew.authors, req.account.username));