api: update mongoose
This commit is contained in:
parent
c7202eadd2
commit
e52575ab87
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"name": "open-bike-sensor-web-api",
|
"name": "open-bike-sensor-web-api",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "Backend API for the OpenBikeSensor web app",
|
"description": "Backend API for the OpenBikeSensor web app",
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
"luxon": "^1.26.0",
|
"luxon": "^1.26.0",
|
||||||
"method-override": "3.0.0",
|
"method-override": "3.0.0",
|
||||||
"methods": "1.1.2",
|
"methods": "1.1.2",
|
||||||
"mongoose": "^5.11.17",
|
"mongoose": "^6.0.5",
|
||||||
"mongoose-data-migrate": "flashstockinc/mongoose-data-migrate",
|
"mongoose-data-migrate": "flashstockinc/mongoose-data-migrate",
|
||||||
"mongoose-unique-validator": "2.0.3",
|
"mongoose-unique-validator": "2.0.3",
|
||||||
"morgan": "1.10.0",
|
"morgan": "1.10.0",
|
||||||
|
|
|
@ -148,7 +148,7 @@ class Track extends mongoose.Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
async generateFilePath() {
|
async generateFilePath() {
|
||||||
await this.populate('author').execPopulate();
|
await this.populate('author');
|
||||||
this.filePath = path.join(this.author.username, this.slug);
|
this.filePath = path.join(this.author.username, this.slug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -310,8 +310,7 @@ router.get(
|
||||||
createdAt: 'asc',
|
createdAt: 'asc',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
.execPopulate();
|
|
||||||
|
|
||||||
return res.json({
|
return res.json({
|
||||||
comments: req.track.comments.map(function (comment) {
|
comments: req.track.comments.map(function (comment) {
|
||||||
|
|
Loading…
Reference in a new issue