feat: ignore alerts older than 1 week
This commit is contained in:
parent
ab15930780
commit
0249005314
1 changed files with 1 additions and 1 deletions
|
|
@ -82,7 +82,7 @@ const hasUnreadNotifications = () => {
|
|||
|
||||
const getAlerts = () => {
|
||||
const types = ['fiatBalance', 'cryptoBalance', 'error']
|
||||
const sql = `SELECT * FROM notifications WHERE valid = 't' AND type IN ($1:list) ORDER BY created DESC`
|
||||
const sql = `SELECT * FROM notifications WHERE valid = 't' AND created > (CURRENT_TIMESTAMP - INTERVAL '7' DAY) 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