Skip to content

Commit

Permalink
fix commented line
Browse files Browse the repository at this point in the history
  • Loading branch information
AVtheking committed Nov 25, 2023
1 parent 12daca7 commit 6b35c62
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions controllers/course_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,11 @@ const courseCtrl = {
const courseIdIndex = user.ownedCourse.findIndex((course) =>
course.courseId.equals(courseId)
);
// if (courseIdIndex == -1) {
// return next(
// new ErrorHandler(400, "You have not enrolled in this course")
// );
// }
if (courseIdIndex == -1) {
return next(
new ErrorHandler(400, "You have not enrolled in this course")
);
}

const reviewIndex = course.reviews.findIndex((review) =>
review.user.equals(req.user._id)
Expand Down

0 comments on commit 6b35c62

Please sign in to comment.