Merge pull request #394 from strapi/fix/models-functions

Fix models functions life cycle
This commit is contained in:
Jim LAURIE 2017-12-21 13:46:44 +01:00 committed by GitHub
commit a19a445d73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,6 +87,7 @@ module.exports = function (strapi) {
// Initialize lifecycle callbacks.
const preLifecycle = {
validate: 'beforeCreate',
findOneAndRemove: 'beforeDestroy',
remove: 'beforeDestroy',
update: 'beforeUpdate',
find: 'beforeFetchAll',
@ -104,6 +105,7 @@ module.exports = function (strapi) {
const postLifecycle = {
validate: 'afterCreate',
findOneAndRemove: 'afterDestroy',
remove: 'afterDestroy',
update: 'afterUpdate',
find: 'afterFetchAll',