first commit

This commit is contained in:
2026-07-30 12:15:17 +03:00
commit 1f29eead28
48 changed files with 10666 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { NextResponse } from 'next/server'
import { prisma } from '@/lib/db'
import { requireAdmin } from '@/lib/auth-helpers'
import { MOCK_MESSAGES } from '@/lib/mock'
const USE_MOCK = process.env.USE_MOCK === 'true'
export async function GET() {
try {
await requireAdmin()
const data = USE_MOCK
? MOCK_MESSAGES
: await prisma.contactMessage.findMany({
where: { deletedAt: null },
orderBy: { createdAt: 'desc' },
})
return NextResponse.json({ data })
} catch {
return NextResponse.json({ error: 'Server error' }, { status: 500 })
}
}