Chore: change misleading query name

This commit is contained in:
csrapr 2021-02-17 17:51:36 +00:00 committed by Josh Harvey
parent b89ba7d939
commit 2401238b2f
5 changed files with 45 additions and 28 deletions

View file

@ -56,10 +56,9 @@ const getNotifications = () => {
const sql = `SELECT * FROM notifications ORDER BY created DESC`
return db.any(sql).catch(console.error)
}
const markAsRead = (id) => {
const sql = `UPDATE notifications SET read = 't' WHERE id = $1`
return db.none(sql, [id]).catch(console.error)
const setRead = (id, read) => {
const sql = `UPDATE notifications SET read = $1 WHERE id = $2`
return db.none(sql, [read, id]).catch(console.error)
}
const markAllAsRead = () => {
@ -87,7 +86,7 @@ module.exports = {
clearBlacklistNotification,
getValidNotifications,
getNotifications,
markAsRead,
setRead,
markAllAsRead,
hasUnreadNotifications,
getAlerts,