delete bulk and export/import

Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2025-10-26 12:31:35 +01:00
padre e0f561de09
commit 28eea2a7ae
Se han modificado 5 ficheros con 536 adiciones y 9 borrados

Ver fichero

@@ -0,0 +1,27 @@
import { NextResponse } from 'next/server';
import ovhService from '@/lib/ovh-service';
export async function GET(request, { params }) {
try {
const { domain } = await params;
// Get all records
const records = await ovhService.getDNSRecords(domain);
// Export to BIND9 format
const zoneFile = ovhService.exportToBind9(domain, records);
return new NextResponse(zoneFile, {
headers: {
'Content-Type': 'text/plain',
'Content-Disposition': `attachment; filename="${domain}.zone"`
}
});
} catch (error) {
console.error('Error exporting DNS zone:', error);
return NextResponse.json(
{ success: false, error: error.message },
{ status: 500 }
);
}
}