fix(admin): persist data directory and pass env vars

This commit is contained in:
Schubert Ferenc 2026-07-03 22:25:04 +02:00
parent 99e8201745
commit 1d7e7c41c9
39 changed files with 1297 additions and 32 deletions

View file

@ -1,4 +1,5 @@
import { NextResponse } from "next/server";
import { addContactInquiry } from "@/lib/admin/store";
function text(value: FormDataEntryValue | null) {
return typeof value === "string" ? value.trim() : "";
@ -8,16 +9,14 @@ export async function POST(request: Request) {
const form = await request.formData();
const name = text(form.get("name"));
const email = text(form.get("email"));
const subject = text(form.get("subject"));
const message = text(form.get("message"));
if (!name || !email.includes("@") || message.length < 10 || form.get("privacy") !== "on") {
if (!name || !email.includes("@") || !subject || message.length < 10 || form.get("privacy") !== "on") {
return NextResponse.json({ message: "Bitte füllen Sie alle Pflichtfelder aus." }, { status: 400 });
}
console.info("contact_request.received", {
messageLength: message.length,
hasEmail: true,
});
await addContactInquiry(form);
return NextResponse.json({
message: "Ihre Nachricht wurde erfasst. Sie erhalten eine Rückmeldung.",