0
0
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:
Víctor Losada Hernández
2025-08-21 16:02:09 +02:00
committed by GitHub

View File

@@ -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 = {