refactor: drop getMachineName() from notifier
This commit is contained in:
parent
374a4272a5
commit
d2cdca701a
2 changed files with 5 additions and 10 deletions
|
|
@ -15,12 +15,6 @@ compliance - notifications related to warnings triggered by compliance settings
|
|||
error - notifications related to errors
|
||||
*/
|
||||
|
||||
function getMachineName (machineId) {
|
||||
const sql = 'SELECT * FROM devices WHERE device_id=$1'
|
||||
return db.oneOrNone(sql, [machineId])
|
||||
.then(it => it.name).catch(logger.error)
|
||||
}
|
||||
|
||||
const addNotification = (type, message, detail) => {
|
||||
const sql = `INSERT INTO notifications (id, type, message, detail) VALUES ($1, $2, $3, $4)`
|
||||
return db.oneOrNone(sql, [uuidv4(), type, message, detail]).catch(logger.error)
|
||||
|
|
@ -105,5 +99,4 @@ module.exports = {
|
|||
markAllAsRead,
|
||||
hasUnreadNotifications,
|
||||
getAlerts,
|
||||
getMachineName
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue