diff --git a/app/api/pages/[slug]/pdf/route.tsx b/app/api/pages/[slug]/pdf/route.tsx index e6380351..ff304d06 100644 --- a/app/api/pages/[slug]/pdf/route.tsx +++ b/app/api/pages/[slug]/pdf/route.tsx @@ -4,11 +4,28 @@ import configPromise from '@payload-config'; import { renderToStream } from '@react-pdf/renderer'; import React from 'react'; import { PDFPage } from '@/lib/pdf-page'; +import fs from 'fs'; +import path from 'path'; export async function GET(req: NextRequest, { params }: { params: Promise<{ slug: string }> }) { try { const { slug } = await params; + // Hardcoded bypass for AGBs to use the original uploaded PDF. + if (slug === 'agbs') { + const filePath = path.join(process.cwd(), 'public', 'AVB-KLZ-4-2026.pdf'); + if (fs.existsSync(filePath)) { + const fileBuffer = fs.readFileSync(filePath); + return new NextResponse(fileBuffer, { + status: 200, + headers: { + 'Content-Type': 'application/pdf', + 'Content-Disposition': `attachment; filename="AVB-KLZ-4-2026.pdf"`, + }, + }); + } + } + // Get Payload App const payload = await getPayload({ config: configPromise }); diff --git a/public/AVB-KLZ-4-2026.pdf b/public/AVB-KLZ-4-2026.pdf index 6f7420da..a43cdb61 100644 Binary files a/public/AVB-KLZ-4-2026.pdf and b/public/AVB-KLZ-4-2026.pdf differ