This commit is contained in:
lesion
2019-06-09 00:45:50 +02:00
parent ccaf53aa24
commit 792bc64ce5
16 changed files with 144 additions and 105 deletions

View File

@@ -28,4 +28,4 @@ module.exports = (sequelize, DataTypes) => {
// associations can be defined here
}
return event
};
}

View File

@@ -6,14 +6,18 @@ module.exports = {
references: {
model: 'events',
key: 'id'
}
},
onDelete: 'cascade',
onUpdate: 'cascade'
},
notificationId: {
type: Sequelize.INTEGER,
references: {
model: 'notifications',
key: 'id'
}
},
onDelete: 'cascade',
onUpdate: 'cascade'
},
status: {
type: Sequelize.ENUM,

View File

@@ -7,14 +7,18 @@ module.exports = {
references: {
model: 'events',
key: 'id'
}
},
onDelete: 'cascade',
onUpdate: 'cascade'
},
tagTag: {
type: Sequelize.STRING,
references: {
model: 'tags',
key: 'tag'
}
},
onDelete: 'cascade',
onUpdate: 'cascade'
},
createdAt: {
allowNull: false,

View File

@@ -31,7 +31,6 @@ async function sendNotification(notification, event, eventNotification) {
}
async function notify() {
console.error('dentro il loop di notify')
settings = await settingsController.settings()
// get all event notification in queue
const eventNotifications = await EventNotification.findAll({ where: { status: 'new' } })