mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-01 10:52:46 +00:00
Fix metadata in Google docs
Update view counts via service account since modifying another users' file properties requires increased permission scope
This commit is contained in:
@@ -149,6 +149,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();
|
||||
|
||||
Reference in New Issue
Block a user