Skip to content

Commit ece30a8

Browse files
Finish courseID route
1 parent 2d9b4a5 commit ece30a8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
.idea/
33
dist/
4-
.nyc_output/
4+
.nyc_output/
5+
npm-debug.log.*

src/routes/course.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ router.get('/:courseId', (req, res, next) => {
2626
Course
2727
.findById(req.params.courseId)
2828
.populate('user')
29-
.populate('reviews')
29+
.populate({path: 'reviews',
30+
populate: {path: 'user'}})
3031
.exec((err, course) => {
3132
Utils.isError(err, next);
3233
res.locals.course = course;

0 commit comments

Comments
 (0)