diff --git a/modules/zone/back/models/zone-closure.js b/modules/zone/back/models/zone-closure.js index 33e43d791..d25d6f707 100644 --- a/modules/zone/back/models/zone-closure.js +++ b/modules/zone/back/models/zone-closure.js @@ -1,11 +1,11 @@ -const {models} = require('vn-loopback/server/server'); +const app = require('vn-loopback/server/server'); module.exports = Self => { app.on('started', function() { let models = ['Zone', 'ZoneEvent', 'ZoneExclusion']; for (let modelName of models) { - let Model = models[modelName]; + let Model = app.models[modelName]; Model.observe('after save', doCalc); Model.observe('after delete', doCalc);