Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions client/src/components/DocGrid/DocGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ const DocGrid = () => {
const { user, getUser } = useContext(UserContext);
const langKey = useSelector((store) => store.config.lang);

console.log(user);

const [notes, setNotes] = useState([]);

const handleNoteClick = (note) => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Navbar = () => {
});
});
} catch (error) {
console.log(error);
console.error(error);
}
};

Expand Down
4 changes: 2 additions & 2 deletions client/src/components/UploadPage/UploadPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const UploadPage = () => {
});
setAddSubject_("");
} catch (error) {
console.log(error);
console.error(error);
}
};

Expand Down Expand Up @@ -227,7 +227,7 @@ const UploadPage = () => {
`${import.meta.env.VITE_BASE_URL}/request/delete/${requestId}`,
config
);
console.log(`Request with ID ${requestId} deleted successfully.`);

} catch (error) {
console.error(`Error deleting request with ID ${requestId}:`, error);
}
Expand Down
4 changes: 2 additions & 2 deletions server/controllers/question.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ const getQuestion = wrapAsync(async (req, res) => {
const deleteQuestion = wrapAsync(async (req, res) => {
try {
const questionId = req.params.questionId;
const deletedQuestion = await Request.findByIdAndDelete(questionId);
const deletedQuestion = await Question.findByIdAndDelete(questionId);
if (!deletedQuestion) {
return res.status(404).json({ message: "Question not found" });
}
res.status(200).json({ message: "Question deleted successfully" });
} catch {
} catch (error) {
console.error(error);
res
.status(500)
Expand Down
9 changes: 2 additions & 7 deletions server/controllers/user.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const registerUser = wrapAsync(async (req, res) => {
.status(200)
.json({ user: registeredUser, token, message: "Check for OTP" });
} catch (error) {
console.log(error.message);
console.error(error.message);
res.status(400).json({
message: "Register failed",
error: error.message,
Expand Down Expand Up @@ -107,14 +107,13 @@ const verifyOtp = wrapAsync(async (req, res) => {
});
}
} else {
console.log("User not found");
return res.status(404).json({
message: "User not found",
success: false,
});
}
} catch (error) {
console.log(error);
console.error(error);
return res.status(500).json({
success: false,
message: "Internal Server Error",
Expand Down Expand Up @@ -185,7 +184,6 @@ const getUser = wrapAsync(async (req, res) => {
const token =
req.cookies.token ||
(req.headers.authorization && req.headers.authorization.split(" ")[1]);
console.log(token);
if (!token) {
return res.status(401).json({
message: "Unauthorized",
Expand All @@ -203,7 +201,6 @@ const getUser = wrapAsync(async (req, res) => {
try {
// Assuming you have a User model with findById method
const user = await User.findById(decoded._id).select("-password");
console.log(user);
if (!user) {
return res.status(404).json({
message: "User not found",
Expand Down Expand Up @@ -281,7 +278,6 @@ const vefifyPasswordOtp = async (req, res) => {
if (user.otp == otp) {
user.isVerified = true;
const updated = await user.save();
console.log(updated);
await User.updateOne({ email: email }, { $set: { otp: otp } });
return res.status(200).json({
message: "OTP verified successfully",
Expand Down Expand Up @@ -310,7 +306,6 @@ const updatePassword = async (req, res) => {
message: "Invalid attempt, please try again",
});
}
console.log(user.isVerified);
if (user.isVerified == false) {
return res.status(400).json({
message: "OTP not verified",
Expand Down
2 changes: 0 additions & 2 deletions server/middlewares/verifyToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const verifyToken = (req, res, next) => {
if (err) {
res.status(403).send("Token is not valid");
}
// if()
console.log(data);
req.user = data;
next();
});
Expand Down
Loading