Skip to content

Commit

Permalink
rebases
Browse files Browse the repository at this point in the history
  • Loading branch information
AVtheking committed Nov 26, 2023
1 parent 6097761 commit f3caf1d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions controllers/course_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,14 +654,13 @@ const courseCtrl = {
if (!course) {
return next(new ErrorHandler(404, "Course not found"));
}
// const totalPage = await course.reviews.countDocuments();
// const totalPages = Math.ceil(totalPage / pageSize);

const paginatedReviews = course.reviews.slice(
startIndex,
startIndex + pageSize
);
const totalPages = Math.ceil(course.reviews.length / pageSize);
// console.log(course.reviews.length);

res.json({
success: true,
message: "List of reviews",
Expand Down

0 comments on commit f3caf1d

Please sign in to comment.