From 540e191d27586f49ab8d74a9fb853e2e7213ee25 Mon Sep 17 00:00:00 2001 From: SowinskiBraeden Date: Fri, 9 May 2025 09:49:14 -0700 Subject: [PATCH] refactor/remove debug statements --- src/auth/authentication.js | 2 +- src/public/scripts/geolocation.js | 2 -- src/router/user.js | 7 +------ 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/auth/authentication.js b/src/auth/authentication.js index a540751..727f4e7 100644 --- a/src/auth/authentication.js +++ b/src/auth/authentication.js @@ -84,7 +84,7 @@ module.exports = (users) => { financialData: false, }).then((results, err) => { if (err) { - console.error(err); + console.error("Error creating user on signup: ", err); res.session.errMessage = "Internal server error"; return res.status(status.InternalServerError).redirect("/signup"); } diff --git a/src/public/scripts/geolocation.js b/src/public/scripts/geolocation.js index 51096a6..7fce450 100644 --- a/src/public/scripts/geolocation.js +++ b/src/public/scripts/geolocation.js @@ -37,8 +37,6 @@ function update(data) { dropdown.appendChild(listItem); }); - - // console.log(data); } function switchButton(clickedButton) { diff --git a/src/router/user.js b/src/router/user.js index dc8b232..8816990 100644 --- a/src/router/user.js +++ b/src/router/user.js @@ -98,9 +98,7 @@ module.exports = (middleware, users, plans, assets) => { router.get('/plans', async (req, res) => { try { - // console.log(new ObjectId(req.session.user._id)); const userPlansFromDB = await plans.find({userId: new ObjectId(req.session.user._id) }).toArray(); - // console.log(userPlansFromDB); // Use a for...of loop for proper async/await behavior in series for updates for (const plan of userPlansFromDB) { @@ -142,7 +140,6 @@ module.exports = (middleware, users, plans, assets) => { req.session.errMessage = "Plan not found or you do not have permission to view it."; return res.status(status.NotFound).redirect('/plans'); } - // console.log("Found plan:", plan); // The plan.progress should be up-to-date from the database as it was updated in the /plans route // or when assets/plans are modified. If an immediate recalculation for this specific view is absolutely needed, @@ -254,9 +251,7 @@ module.exports = (middleware, users, plans, assets) => { }); }); - router.post('/questionnaire', (req, res) => { - // console.log("Questionnaire POST body:", req.body); - + router.post('/questionnaire', (req, res) => { const questionnaireSchema = joi.object({ dob: joi.date().required(), education: joi.string().valid('primary', 'secondary', 'tertiary', 'postgraduate').required(),