mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-09 15:52:43 +00:00
Remove duplicate error log for googleActions.list
This commit is contained in:
@@ -379,22 +379,12 @@ app.get('/account', asyncHandler(async (req, res, next)=>{
|
|||||||
let googleCount = [];
|
let googleCount = [];
|
||||||
if(req.account) {
|
if(req.account) {
|
||||||
if(req.account.googleId) {
|
if(req.account.googleId) {
|
||||||
try {
|
auth = await GoogleActions.authCheck(req.account, res, false)
|
||||||
auth = await GoogleActions.authCheck(req.account, res, false);
|
|
||||||
} catch (e) {
|
googleCount = await GoogleActions.listGoogleBrews(auth)
|
||||||
auth = undefined;
|
.catch((err)=>{
|
||||||
console.log('Google auth check failed!');
|
console.error(err);
|
||||||
console.log(e);
|
});
|
||||||
}
|
|
||||||
if(auth.credentials.access_token) {
|
|
||||||
try {
|
|
||||||
googleCount = await GoogleActions.listGoogleBrews(auth);
|
|
||||||
} catch (e) {
|
|
||||||
googleCount = undefined;
|
|
||||||
console.log('List Google files failed!');
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const query = { authors: req.account.username, googleId: { $exists: false } };
|
const query = { authors: req.account.username, googleId: { $exists: false } };
|
||||||
@@ -408,7 +398,7 @@ app.get('/account', asyncHandler(async (req, res, next)=>{
|
|||||||
username : req.account.username,
|
username : req.account.username,
|
||||||
issued : req.account.issued,
|
issued : req.account.issued,
|
||||||
googleId : Boolean(req.account.googleId),
|
googleId : Boolean(req.account.googleId),
|
||||||
authCheck : Boolean(req.account.googleId && auth.credentials.access_token),
|
authCheck : Boolean(req.account.googleId && auth?.credentials.access_token),
|
||||||
mongoCount : mongoCount,
|
mongoCount : mongoCount,
|
||||||
googleCount : googleCount?.length
|
googleCount : googleCount?.length
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -121,9 +121,7 @@ const GoogleActions = {
|
|||||||
})
|
})
|
||||||
.catch((err)=>{
|
.catch((err)=>{
|
||||||
console.log(`Error Listing Google Brews`);
|
console.log(`Error Listing Google Brews`);
|
||||||
console.error(err);
|
|
||||||
throw (err);
|
throw (err);
|
||||||
//TODO: Should break out here, but continues on for some reason.
|
|
||||||
});
|
});
|
||||||
fileList.push(...obj.data.files);
|
fileList.push(...obj.data.files);
|
||||||
NextPageToken = obj.data.nextPageToken;
|
NextPageToken = obj.data.nextPageToken;
|
||||||
|
|||||||
Reference in New Issue
Block a user