fix: validate ID parsing in API routes and player pages for Prisma v7

This commit is contained in:
2026-03-31 00:21:02 -07:00
parent 0f66815ed4
commit a1fb0e25a7
4 changed files with 28 additions and 4 deletions
@@ -7,7 +7,15 @@ export async function POST(
{ params }: { params: { id: string } }
) {
try {
const tournamentId = parseInt(params.id);
const tournamentId = parseInt(params.id, 10);
if (isNaN(tournamentId)) {
return NextResponse.json(
{ error: "Invalid tournament ID" },
{ status: 400 }
);
}
const body = await request.json();
const { playerIds } = body;