feat: show only notifications of the past week
This commit is contained in:
parent
2646948fbf
commit
f27f85b418
1 changed files with 5 additions and 1 deletions
|
|
@ -54,7 +54,11 @@ const getValidNotifications = (type, detail) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getNotifications = () => {
|
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)
|
return db.any(sql).catch(logger.error)
|
||||||
}
|
}
|
||||||
const setRead = (id, read) => {
|
const setRead = (id, read) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue