Merge cursor/umfassende-plattform-berarbeitung-d0f0 into dev_test

Resolve email API TLS/env var merge conflicts and bring latest platform changes into dev_test.
This commit is contained in:
Cursor Agent
2026-01-14 02:11:17 +00:00
102 changed files with 6325 additions and 1780 deletions

View File

@@ -26,7 +26,20 @@ export async function POST(request: NextRequest) {
// Track page view
if (type === 'pageview' && page) {
const projectIdNum = projectId ? parseInt(projectId.toString()) : null;
let projectIdNum: number | null = null;
if (projectId != null) {
const raw = projectId.toString();
const parsed = parseInt(raw, 10);
if (Number.isFinite(parsed)) {
projectIdNum = parsed;
} else {
const bySlug = await prisma.project.findFirst({
where: { slug: raw },
select: { id: true },
});
projectIdNum = bySlug?.id ?? null;
}
}
// Create page view record
await prisma.pageView.create({
@@ -83,7 +96,7 @@ export async function POST(request: NextRequest) {
where: {
OR: [
{ id: parseInt(slug) || 0 },
{ title: { contains: slug, mode: 'insensitive' } }
{ slug }
]
}
});