mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 20:42:43 +00:00
Merge pull request #4382 from emmanuel-ferdman/master
Handle mongo count qurey error by returning default value
This commit is contained in:
@@ -487,8 +487,8 @@ app.get('/account', asyncHandler(async (req, res, next)=>{
|
||||
const query = { authors: req.account.username, googleId: { $exists: false } };
|
||||
const mongoCount = await HomebrewModel.countDocuments(query)
|
||||
.catch((err)=>{
|
||||
mongoCount = 0;
|
||||
console.log(err);
|
||||
return 0;
|
||||
});
|
||||
|
||||
data.accountDetails = {
|
||||
|
||||
Reference in New Issue
Block a user