0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Merge pull request #1118 from naturalcrit/fixGoogleMetadata

Fix metadata in Google docs
This commit is contained in:
Trevor Buckner
2020-11-25 13:26:14 -05:00
committed by GitHub
7 changed files with 95 additions and 36 deletions

View File

@@ -152,6 +152,10 @@ app.get('/share/:id', (req, res, next)=>{
const googleId = req.params.id.slice(0, -12);
const shareId = req.params.id.slice(-12);
GoogleActions.readFileMetadata(config.get('google_api_key'), googleId, shareId, 'share')
.then((brew)=>{
GoogleActions.increaseView(googleId, shareId, 'share', brew);
return brew;
})
.then((brew)=>{
req.brew = brew; //TODO Need to sanitize later
return next();