Model fix
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Joan Sanchez 2023-01-24 09:20:02 +01:00
parent 0208b31f44
commit 3456438485
1 changed files with 2 additions and 2 deletions

View File

@ -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);