v1.0.2: Fix PDF generation (react-pdf v4), fix Next.js 15 async params in all API routes

This commit is contained in:
Pepe Ziberi
2026-02-21 13:56:44 +01:00
parent 10464d34ff
commit 2b7a89174a
22 changed files with 263 additions and 348 deletions

View File

@@ -4,8 +4,9 @@ import { getSession } from '@/lib/auth'
import { sendEmail } from '@/lib/email'
// POST: Send rapport link via email
export async function POST(req: NextRequest, { params }: { params: { token: string } }) {
export async function POST(req: NextRequest, { params }: { params: Promise<{ token: string }> }) {
try {
const { token } = await params
const user = await getSession()
if (!user) return NextResponse.json({ error: 'Nicht autorisiert' }, { status: 401 })
@@ -13,7 +14,7 @@ export async function POST(req: NextRequest, { params }: { params: { token: stri
if (!email) return NextResponse.json({ error: 'E-Mail-Adresse erforderlich' }, { status: 400 })
const rapport = await (prisma as any).rapport.findUnique({
where: { token: params.token },
where: { token },
include: {
tenant: { select: { name: true } },
project: { select: { title: true, location: true } },