Merge pull request #1707 from RafaelTaranto/fix/fetch-only-valid-alerts

LAM-1110 fix: only fetch valid alerts
This commit is contained in:
Rafael Taranto 2024-08-16 12:24:55 +01:00 committed by GitHub
commit 10ea642c11

View file

@ -86,7 +86,7 @@ const getAlerts = () => {
const types = ['fiatBalance', 'cryptoBalance', 'error']
const sql = `
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
`
return db.any(sql, [types]).catch(logger.error)