mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-02 12:52:38 +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 query = { authors: req.account.username, googleId: { $exists: false } };
|
||||||
const mongoCount = await HomebrewModel.countDocuments(query)
|
const mongoCount = await HomebrewModel.countDocuments(query)
|
||||||
.catch((err)=>{
|
.catch((err)=>{
|
||||||
mongoCount = 0;
|
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
data.accountDetails = {
|
data.accountDetails = {
|
||||||
|
|||||||
Reference in New Issue
Block a user