mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 01:22:44 +00:00
Account information added
This commit is contained in:
@@ -39,10 +39,18 @@ const AccountPage = createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
uiItems : function() {
|
uiItems : function() {
|
||||||
|
// console.log(JSON.stringify(this.props.uiItems));
|
||||||
const result = <>
|
const result = <>
|
||||||
<h1>Account Information</h1>
|
<h1>Account Information</h1>
|
||||||
<p><strong>Username: </strong> {this.props.uiItems.username}</p>
|
<p><strong>Username: </strong> {this.props.uiItems.username || 'No user currently logged in'}</p>
|
||||||
<p><strong>Issued: </strong> {this.props.uiItems.issued}</p>
|
<p><strong>Issued: </strong> {this.props.uiItems.issued || '-'}</p>
|
||||||
|
<p></p>
|
||||||
|
<h3>MongoDB Information</h3>
|
||||||
|
<p><strong>Brews on MongoDB: </strong> {this.props.uiItems.mongoCount || '-'}</p>
|
||||||
|
<p></p>
|
||||||
|
<h3>Google Information</h3>
|
||||||
|
<p><strong>Linked to Google: </strong> {this.props.uiItems.googleId ? 'YES' : 'NO'}</p>
|
||||||
|
{this.props.uiItems.googleId ? <p><strong>Brews on Google: </strong> {this.props.uiItems.fileCount || '-'}</p> : '' }
|
||||||
</>;
|
</>;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ app.get('/print/:id', asyncHandler(async (req, res, next)=>{
|
|||||||
//Account Page
|
//Account Page
|
||||||
app.get('/ui/account', asyncHandler(async (req, res, next)=>{
|
app.get('/ui/account', asyncHandler(async (req, res, next)=>{
|
||||||
const brew = {};
|
const brew = {};
|
||||||
brew.title = 'ACCOUNT';
|
brew.title = 'ACCOUNT INFORMATION PAGE';
|
||||||
|
|
||||||
let auth;
|
let auth;
|
||||||
let files;
|
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 = {
|
brew.uiItems = {
|
||||||
username : req.account.username,
|
username : req.account.username,
|
||||||
issued : req.account.issued,
|
issued : req.account.issued,
|
||||||
googleId : Boolean(req.account.googleId),
|
mongoCount : brews.length,
|
||||||
authCheck : Boolean(req.account.googleId && auth.credentials.access_token),
|
googleId : Boolean(req.account.googleId),
|
||||||
fileCount : files?.length
|
authCheck : Boolean(req.account.googleId && auth.credentials.access_token),
|
||||||
|
fileCount : files?.length || '-'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user