fix(admin): persist data directory and pass env vars
This commit is contained in:
parent
99e8201745
commit
1d7e7c41c9
39 changed files with 1297 additions and 32 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import { addRepairInquiry } from "@/lib/admin/store";
|
||||
|
||||
function required(value: FormDataEntryValue | null) {
|
||||
return typeof value === "string" && value.trim().length > 0;
|
||||
|
|
@ -18,18 +19,7 @@ export async function POST(request: Request) {
|
|||
return NextResponse.json({ message: "Bitte füllen Sie alle Pflichtfelder aus." }, { status: 400 });
|
||||
}
|
||||
|
||||
const intakeUrl = process.env.OLYMPUS_INTAKE_API_URL;
|
||||
const hasIntegrationToken = Boolean(process.env.OLYMPUS_INTAKE_API_TOKEN);
|
||||
|
||||
console.info("repair_intake.received", {
|
||||
hasIntakeIntegration: Boolean(intakeUrl && hasIntegrationToken),
|
||||
manufacturer: String(manufacturer),
|
||||
model: String(model),
|
||||
deviceType: String(deviceType),
|
||||
hasPhone: required(form.get("phone")),
|
||||
hasSerialNumber: required(form.get("serialNumber")),
|
||||
hasAccessories: required(form.get("accessories")),
|
||||
});
|
||||
await addRepairInquiry(form);
|
||||
|
||||
return NextResponse.json({
|
||||
message: "Ihre Reparaturanfrage wurde erfasst. Sie erhalten nach Prüfung eine Rückmeldung.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue