Feat: compliance blacklisted addresses notifications

This commit is contained in:
Cesar 2020-12-15 18:55:45 +00:00 committed by Josh Harvey
parent 1ec56cd1ab
commit 705747e9e0
7 changed files with 48 additions and 14 deletions

View file

@ -66,6 +66,11 @@ const hasUnreadNotifications = () => {
return db.oneOrNone(sql).then(res => res.exists)
}
const addComplianceNotification = (deviceId, detail, message) => {
const sql = `INSERT INTO notifications (id, type, detail, device_id, message, created) values ($1, 'compliance', $2, $3, $4, CURRENT_TIMESTAMP)`
return db.oneOrNone(sql, [uuidv4(), detail, deviceId, message])
}
module.exports = {
machineEvents: dbm.machineEvents,
addNotification,