diff --git a/server/src/controllers/auth.controller.js b/server/src/controllers/auth.controller.js index ab249425..1b443f1a 100644 --- a/server/src/controllers/auth.controller.js +++ b/server/src/controllers/auth.controller.js @@ -289,3 +289,5 @@ export const resetPassword = asyncHandler(async (req, res) => { }); }); + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/server/src/controllers/message.controller.js b/server/src/controllers/message.controller.js index fe5ece7f..b4b3a461 100644 --- a/server/src/controllers/message.controller.js +++ b/server/src/controllers/message.controller.js @@ -42,7 +42,7 @@ export const getMessages = asyncHandler(async (req, res) => { } } - const limit = Math.min(Math.max(parseInt(req.query.limit) || 50, 1), MAX_LIMIT); + const limit = Math.min(Math.max(parseInt(req.query.limit, 10) || 50, 1), MAX_LIMIT); const before = req.query.before; let beforeId; diff --git a/server/src/controllers/post.controller.js b/server/src/controllers/post.controller.js index c2f0b06d..2c22de2d 100644 --- a/server/src/controllers/post.controller.js +++ b/server/src/controllers/post.controller.js @@ -335,7 +335,7 @@ poll = { export const getPosts = asyncHandler(async (req, res) => { const cursor = req.query.cursor; - const limit = Math.min(Math.max(parseInt(req.query.limit) || 10, 1), MAX_LIMIT); + const limit = Math.min(Math.max(parseInt(req.query.limit, 10) || 10, 1), MAX_LIMIT); let filter = { isDeleted: { $ne: true } }; if (req.user) {