first commit

This commit is contained in:
AyrisAI
2026-05-14 01:57:52 +03:00
parent 863a32cd35
commit 4a9196f483
47 changed files with 12043 additions and 102 deletions

View File

@@ -0,0 +1,18 @@
import { NextRequest, NextResponse } from "next/server";
import { auth } from "@/auth";
import { deleteDomain } from "@/lib/mailcow";
// DELETE /api/domains/[domain] — super admin only
export async function DELETE(
_req: NextRequest,
{ params }: { params: Promise<{ domain: string }> }
) {
const session = await auth();
if (!session || session.user.role !== "SUPER_ADMIN") {
return NextResponse.json({ error: "Forbidden" }, { status: 403 });
}
const { domain } = await params;
const result = await deleteDomain(decodeURIComponent(domain));
return NextResponse.json(result.data, { status: result.ok ? 200 : 502 });
}