fix: only fetch valid alerts

This commit is contained in:
Rafael Taranto 2024-08-14 09:07:26 +01:00
parent 442d1a749d
commit e7a610d926

View file

@ -86,7 +86,7 @@ const getAlerts = () => {
const types = ['fiatBalance', 'cryptoBalance', 'error'] const types = ['fiatBalance', 'cryptoBalance', 'error']
const sql = ` const sql = `
SELECT * FROM notifications SELECT * FROM notifications
WHERE ${WITHIN_PAST_WEEK} AND type IN ($1:list) WHERE ${WITHIN_PAST_WEEK} AND valid='t' AND type IN ($1:list)
ORDER BY created DESC ORDER BY created DESC
` `
return db.any(sql, [types]).catch(logger.error) return db.any(sql, [types]).catch(logger.error)