mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
get notifications
This commit is contained in:
24
src/api/v1/notifications/get_all_unread.sql
Normal file
24
src/api/v1/notifications/get_all_unread.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
-- gets all unread notifications a user has
|
||||
SELECT
|
||||
mcaptcha_notifications.id,
|
||||
mcaptcha_notifications.heading,
|
||||
mcaptcha_notifications.message,
|
||||
mcaptcha_notifications.received,
|
||||
mcaptcha_users.name
|
||||
FROM
|
||||
mcaptcha_notifications
|
||||
INNER JOIN
|
||||
mcaptcha_users
|
||||
ON
|
||||
mcaptcha_notifications.tx = mcaptcha_users.id
|
||||
WHERE
|
||||
mcaptcha_notifications.rx = (
|
||||
SELECT
|
||||
id
|
||||
FROM
|
||||
mcaptcha_users
|
||||
WHERE
|
||||
name = $1
|
||||
)
|
||||
AND
|
||||
mcaptcha_notifications.read IS NULL;
|
||||
Reference in New Issue
Block a user