feat: show only notifications of the past week

This commit is contained in:
siiky 2024-02-14 14:23:17 +00:00
parent 2646948fbf
commit f27f85b418

View file

@ -54,7 +54,11 @@ const getValidNotifications = (type, detail) => {
}
const getNotifications = () => {
const sql = `SELECT * FROM notifications WHERE valid ORDER BY created DESC`
const sql = `
SELECT * FROM notifications
WHERE valid AND created > (CURRENT_TIMESTAMP - INTERVAL '7' DAY)
ORDER BY created DESC
`
return db.any(sql).catch(logger.error)
}
const setRead = (id, read) => {