refactor: ignore invalid notifications

`lib/notifier/queries.js:getNotifications()` is only used in
`lib/new-admin/graphql/resolvers/notification.resolver.js`.

In the UI, the `valid` field is only used together with the `read`
field, with a true value.
This commit is contained in:
siiky 2024-02-14 13:51:48 +00:00
parent 24d0973f12
commit 2646948fbf
3 changed files with 2 additions and 5 deletions

View file

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