- Aggiornato node.js alla versione 22.18.1
- Aggiornato tutti i pacchetti del server all'ultima versione. - passato mongoose da versione 5 a versione 6
This commit is contained in:
@@ -298,7 +298,7 @@ ProjectSchema.statics.getIdParentByIdProj = function (idProj) {
|
||||
|
||||
console.log('INIT getIdParentByIdProj', idProj);
|
||||
|
||||
return Project.findOne({ '_id': ObjectId(idProj) }).then(rec => {
|
||||
return Project.findOne({ '_id': new ObjectId(idProj) }).then(rec => {
|
||||
if (!!rec) {
|
||||
console.log('getIdParentByIdProj', rec.id_parent);
|
||||
return rec.id_parent;
|
||||
@@ -428,9 +428,10 @@ ProjectSchema.pre('save', function (next) {
|
||||
|
||||
var Project = mongoose.model('Projects', ProjectSchema);
|
||||
|
||||
Project.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
Project.createIndexes()
|
||||
.then(() => { })
|
||||
.catch((err) => { throw err; });
|
||||
|
||||
|
||||
module.exports = { Project };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user