Refactor code structure for improved readability and maintainability

This commit is contained in:
Ace
2026-06-23 14:25:39 +02:00
10 changed files with 630 additions and 224 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(