# xCALLY MOTION Changelog
+- * 9750695 - 2016-09-13: fix duplicate events
- * 0cbc254 - 2016-09-13: server side models interval + user
- * 0c84ddb - 2016-09-13: sever side update tools + app.js
- * f8ce2ee - 2016-09-13: automation chat update (server side - emitter)
emitter.on('MailRoom.beforeDestroy', function(doc, options) {
if (doc.IntervalId !== null) {
- updatevoiceExtension(interval);
+ updatevoiceExtension(doc);
}
});
emitter.on('MailRoom.afterCreate', function(doc, options) {
- if (interval.IntervalId !== null) {
- updatevoiceExtension(interval);
+ if (doc.IntervalId !== null) {
+ updatevoiceExtension(doc);
}
});
}
});
}
-
module.exports = Interval;
const emitter = require('cluster-emitter');
-var emitter = require('cluster-emitter');
-
module.exports = function(sequelize, DataTypes) {
var Interval = sequelize.define('Interval', {
name: {
}
}, {
tableName: 'tools_intervals',
- hooks: {
- afterCreate: function(doc) {
- emitter.to(['master']).emit('Interval.afterCreate', doc);
- },
- afterUpdate: function(doc) {
- emitter.to(['master']).emit('Interval.afterUpdate', doc);
- },
- afterDestroy: function(doc) {
- emitter.to(['master']).emit('Interval.afterDestroy', doc);
- }
- },
associate: function(models) {
Interval.hasMany(models.Interval, {
as: 'SubIntervals',