UPDATE: next16 and minifyjson
Some checks failed
Gitea Auto Deploy / Deploy-Container (push) Failing after 1m25s
Some checks failed
Gitea Auto Deploy / Deploy-Container (push) Failing after 1m25s
This commit is contained in:
@@ -6,14 +6,16 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
|
||||
const body = await request.json();
|
||||
const pfIds = body.pfIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
|
||||
if (!Array.isArray(pfIds) || pfIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid pfIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const pfData = await loadPF(pfIds, locale);
|
||||
|
||||
return NextResponse.json(pfData);
|
||||
return new NextResponse(JSON.stringify(pfData), {
|
||||
headers: { "Content-Type": "application/json" }
|
||||
});
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load pf data' }, { status: 500 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user