refactor/remove debug statements
This commit is contained in:
3 files changed
+1
-8
No files matched your search
@@ -84,7 +84,7 @@ module.exports = (users) => {
|
|||||||
financialData: false,
|
financialData: false,
|
||||||
}).then((results, err) => {
|
}).then((results, err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error("Error creating user on signup: ", err);
|
||||||
res.session.errMessage = "Internal server error";
|
res.session.errMessage = "Internal server error";
|
||||||
return res.status(status.InternalServerError).redirect("/signup");
|
return res.status(status.InternalServerError).redirect("/signup");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,8 +37,6 @@ function update(data) {
|
|||||||
|
|
||||||
dropdown.appendChild(listItem);
|
dropdown.appendChild(listItem);
|
||||||
});
|
});
|
||||||
|
|
||||||
// console.log(data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchButton(clickedButton) {
|
function switchButton(clickedButton) {
|
||||||
|
|||||||
@@ -98,9 +98,7 @@ module.exports = (middleware, users, plans, assets) => {
|
|||||||
|
|
||||||
router.get('/plans', async (req, res) => {
|
router.get('/plans', async (req, res) => {
|
||||||
try {
|
try {
|
||||||
// console.log(new ObjectId(req.session.user._id));
|
|
||||||
const userPlansFromDB = await plans.find({userId: new ObjectId(req.session.user._id) }).toArray();
|
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
|
// Use a for...of loop for proper async/await behavior in series for updates
|
||||||
for (const plan of userPlansFromDB) {
|
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.";
|
req.session.errMessage = "Plan not found or you do not have permission to view it.";
|
||||||
return res.status(status.NotFound).redirect('/plans');
|
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
|
// 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,
|
// or when assets/plans are modified. If an immediate recalculation for this specific view is absolutely needed,
|
||||||
@@ -255,8 +252,6 @@ module.exports = (middleware, users, plans, assets) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.post('/questionnaire', (req, res) => {
|
router.post('/questionnaire', (req, res) => {
|
||||||
// console.log("Questionnaire POST body:", req.body);
|
|
||||||
|
|
||||||
const questionnaireSchema = joi.object({
|
const questionnaireSchema = joi.object({
|
||||||
dob: joi.date().required(),
|
dob: joi.date().required(),
|
||||||
education: joi.string().valid('primary', 'secondary', 'tertiary', 'postgraduate').required(),
|
education: joi.string().valid('primary', 'secondary', 'tertiary', 'postgraduate').required(),
|
||||||
|
|||||||
Reference in new issue
Block a user