feat: complete i18n support, telegram webhook, and security improvements
This commit is contained in:
@@ -30,5 +30,13 @@ export async function POST(req: NextRequest) {
|
||||
if (!domain) return NextResponse.json({ error: "domain gerekli" }, { status: 400 });
|
||||
|
||||
const result = await createDomain({ domain, description, mailboxes, quota, maxquota });
|
||||
|
||||
if (result.ok && Array.isArray(result.data)) {
|
||||
const hasError = result.data.some((item: any) => item.type === "error");
|
||||
if (hasError) {
|
||||
return NextResponse.json(result.data, { status: 400 });
|
||||
}
|
||||
}
|
||||
|
||||
return NextResponse.json(result.data, { status: result.ok ? 200 : 502 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user