.
This commit is contained in:
@@ -28,4 +28,4 @@ module.exports = (sequelize, DataTypes) => {
|
||||
// associations can be defined here
|
||||
}
|
||||
return event
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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' } })
|
||||
|
||||
Reference in New Issue
Block a user