Skip to content

Remove console logs from getQuestionsByStandard method #77

@beetle-ai

Description

@beetle-ai

ISSUE_NUMBER: GH-25

Description

The getQuestionsByStandard method in model/userModel.js contains console logs that should be removed before deploying to production.
File: repositories/QuestionBankapi/model/userModel.js
Line: 47, 51
Severity: low

Current Behavior

The method logs the standard value and filtered questions to the console.

Expected Behavior

The method should not log any information to the console in production.

Suggested Fix

Remove the console.log statements from the getQuestionsByStandard method.

Code Context

userSchema.methods.getQuestionsByStandard = async function (standard) {
console.log('Standard:', standard); // Log the standard value
const filteredQuestions = await mongoose.model('QuestionBank').find({
_id: { $in: this.questions },
standard: standard,
});
console.log('Filtered Questions:', filteredQuestions); // Log the filtered questions
return filteredQuestions;
};

Additional Notes

Console logs can expose sensitive information and impact performance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions