Fixed notifications, It shows when you get get a

message and from who
This commit is contained in:
2026-06-23 09:59:53 +02:00
parent ba947cea87
commit 491ff52b90
5 changed files with 32 additions and 2 deletions
+3 -1
View File
@@ -8,7 +8,7 @@ export async function GET() {
if (!user) return NextResponse.json({ error: "Unauthorized" }, { status: 401 })
const result = await query(
`SELECT id, type, title, description, link, is_read, created_at
`SELECT id, type, title, description, link, is_read, created_at, context_id, context_type
FROM notifications
WHERE user_id = $1
ORDER BY created_at DESC
@@ -24,6 +24,8 @@ export async function GET() {
link: r.link,
read: r.is_read,
timestamp: r.created_at,
contextId: r.context_id,
contextType: r.context_type,
}))
const unreadResult = await query(