diff --git a/client/homebrew/pages/accountPage/accountPage.jsx b/client/homebrew/pages/accountPage/accountPage.jsx index 72925ac70..034f9ae05 100644 --- a/client/homebrew/pages/accountPage/accountPage.jsx +++ b/client/homebrew/pages/accountPage/accountPage.jsx @@ -39,10 +39,18 @@ const AccountPage = createClass({ }, uiItems : function() { + // console.log(JSON.stringify(this.props.uiItems)); const result = <>
Username: {this.props.uiItems.username}
-Issued: {this.props.uiItems.issued}
+Username: {this.props.uiItems.username || 'No user currently logged in'}
+Issued: {this.props.uiItems.issued || '-'}
+ +Brews on MongoDB: {this.props.uiItems.mongoCount || '-'}
+ +Linked to Google: {this.props.uiItems.googleId ? 'YES' : 'NO'}
+ {this.props.uiItems.googleId ?Brews on Google: {this.props.uiItems.fileCount || '-'}
: '' } >; return result; diff --git a/server/app.js b/server/app.js index a623af1bc..aa0439ab6 100644 --- a/server/app.js +++ b/server/app.js @@ -275,7 +275,7 @@ app.get('/print/:id', asyncHandler(async (req, res, next)=>{ //Account Page app.get('/ui/account', asyncHandler(async (req, res, next)=>{ const brew = {}; - brew.title = 'ACCOUNT'; + brew.title = 'ACCOUNT INFORMATION PAGE'; let auth; let files; @@ -299,12 +299,18 @@ app.get('/ui/account', asyncHandler(async (req, res, next)=>{ } } + const brews = await HomebrewModel.getByUser(req.account.username, true, 'id') + .catch((err)=>{ + console.log(err); + }); + brew.uiItems = { - username : req.account.username, - issued : req.account.issued, - googleId : Boolean(req.account.googleId), - authCheck : Boolean(req.account.googleId && auth.credentials.access_token), - fileCount : files?.length + username : req.account.username, + issued : req.account.issued, + mongoCount : brews.length, + googleId : Boolean(req.account.googleId), + authCheck : Boolean(req.account.googleId && auth.credentials.access_token), + fileCount : files?.length || '-' }; }