Browse Source

populate travel.user.telegram and phone when get travel by id

master
arnaucode 7 years ago
parent
commit
2c3a12f1ad
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      controllers/travelController.js

+ 1
- 1
controllers/travelController.js

@ -20,7 +20,7 @@ exports.getAllTravels = function(req, res) {
exports.getTravelById = function (req, res) { exports.getTravelById = function (req, res) {
travelModel.findOne({_id: req.params.travelid}) travelModel.findOne({_id: req.params.travelid})
.lean() .lean()
.populate('user', 'username avatar')
.populate('user', 'username avatar telegram phone')
.populate('joins', 'username avatar') .populate('joins', 'username avatar')
.populate('comments', 'comment user') .populate('comments', 'comment user')
.exec(function (err, travel) { .exec(function (err, travel) {

Loading…
Cancel
Save