Use latest release of Mongoose & add comment to explain post remove comment issue

This commit is contained in:
Aurelsicoko 2018-04-23 16:20:04 +02:00
parent 6733dbf317
commit 4afc8a2390
2 changed files with 4 additions and 2 deletions

View File

@ -144,6 +144,8 @@ module.exports = function (strapi) {
save: 'afterSave'
};
// Mongoose doesn't allow post 'remove' event on model.
// See https://github.com/Automattic/mongoose/issues/3054
_.forEach(postLifecycle, (fn, key) => {
if (_.isFunction(target[model.toLowerCase()][fn])) {
collection.schema.post(key, function (doc, next) {

View File

@ -16,7 +16,7 @@
"main": "./lib",
"dependencies": {
"lodash": "^4.17.4",
"mongoose": "^5.0.4",
"mongoose": "^5.0.15",
"mongoose-float": "^1.0.2",
"pluralize": "^6.0.0",
"strapi-utils": "3.0.0-alpha.12"
@ -48,4 +48,4 @@
"npm": ">= 5.3.0"
},
"license": "MIT"
}
}