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

update app, googleActions, and homebrew api based on PR feedback

This commit is contained in:
Charlie Humphreys
2022-02-16 16:53:34 -06:00
parent 59d08a7414
commit 927345b131
3 changed files with 48 additions and 73 deletions

View File

@@ -200,13 +200,16 @@ app.get('/user/:username', async (req, res, next)=>{
});
if(ownAccount && req?.account?.googleId){
const googleBrews = await GoogleActions.listGoogleBrews(req, res)
.catch((err)=>{
console.error(err);
});
const auth = await GoogleActions.authCheck(req.account, res);
let googleBrews = await GoogleActions.listGoogleBrews(auth)
.catch((err)=>{
console.error(err);
});
if(googleBrews)
if(googleBrews) {
googleBrews = googleBrews.map((brew)=>({ ...brew, authors: [req.account.username] }));
brews = _.concat(brews, googleBrews);
}
}
req.brews = _.map(brews, (brew)=>{