Files
Firefly_Srtools/src/app/api/[locale]/pf/[id]/route.ts

22 lines
525 B
TypeScript

import { NextRequest, NextResponse } from 'next/server'
import { loadPF } from '@/lib/loader'
export async function GET(
req: NextRequest,
{ params }: { params: Promise<{ id: string, locale: string }> }
) {
const { id, locale } = await params
const pfData = await loadPF([id], locale)
const pf = pfData[id]
if (!pf) {
return NextResponse.json({ error: 'PF info not found' }, { status: 404 })
}
return new NextResponse(JSON.stringify(pf), {
headers: { "Content-Type": "application/json" }
});
}