refactor: show invalid notifs again
This commit is contained in:
parent
dcfca2099d
commit
a18d924ffb
3 changed files with 7 additions and 4 deletions
|
|
@ -58,7 +58,7 @@ const WITHIN_PAST_WEEK = `created > (CURRENT_TIMESTAMP - INTERVAL '7' DAY)`
|
|||
const getNotifications = () => {
|
||||
const sql = `
|
||||
SELECT * FROM notifications
|
||||
WHERE valid AND ${WITHIN_PAST_WEEK}
|
||||
WHERE ${WITHIN_PAST_WEEK}
|
||||
ORDER BY created DESC
|
||||
`
|
||||
return db.any(sql).catch(logger.error)
|
||||
|
|
@ -77,7 +77,7 @@ const hasUnreadNotifications = () => {
|
|||
const sql = `
|
||||
SELECT EXISTS
|
||||
(SELECT * FROM notifications
|
||||
WHERE valid AND NOT read AND ${WITHIN_PAST_WEEK})
|
||||
WHERE NOT read AND ${WITHIN_PAST_WEEK})
|
||||
`
|
||||
return db.oneOrNone(sql).then(res => res.exists).catch(logger.error)
|
||||
}
|
||||
|
|
@ -86,7 +86,7 @@ const getAlerts = () => {
|
|||
const types = ['fiatBalance', 'cryptoBalance', 'error']
|
||||
const sql = `
|
||||
SELECT * FROM notifications
|
||||
WHERE valid AND ${WITHIN_PAST_WEEK} AND type IN ($1:list)
|
||||
WHERE ${WITHIN_PAST_WEEK} AND type IN ($1:list)
|
||||
ORDER BY created DESC
|
||||
`
|
||||
return db.any(sql, [types]).catch(logger.error)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue