fix: validate tournament ID parsing for Prisma v7 strict type checking

This commit is contained in:
2026-03-31 00:16:22 -07:00
parent 3465082816
commit 0f66815ed4
3 changed files with 15 additions and 3 deletions
+5 -1
View File
@@ -12,7 +12,11 @@ interface PageProps {
} }
export default async function EditTournamentPage({ params }: PageProps) { export default async function EditTournamentPage({ params }: PageProps) {
const tournamentId = parseInt(params.id) const tournamentId = parseInt(params.id, 10)
if (isNaN(tournamentId)) {
notFound()
}
// Check if user can manage this tournament // Check if user can manage this tournament
const permission = await canManageTournament(tournamentId) const permission = await canManageTournament(tournamentId)
+5 -1
View File
@@ -13,7 +13,11 @@ interface PageProps {
} }
export default async function TournamentDetailPage({ params }: PageProps) { export default async function TournamentDetailPage({ params }: PageProps) {
const tournamentId = parseInt(params.id) const tournamentId = parseInt(params.id, 10)
if (isNaN(tournamentId)) {
notFound()
}
// Check if user can manage this tournament // Check if user can manage this tournament
const permission = await canManageTournament(tournamentId) const permission = await canManageTournament(tournamentId)
@@ -12,7 +12,11 @@ interface PageProps {
} }
export default async function TournamentResultsPage({ params }: PageProps) { export default async function TournamentResultsPage({ params }: PageProps) {
const tournamentId = parseInt(params.id) const tournamentId = parseInt(params.id, 10)
if (isNaN(tournamentId)) {
notFound()
}
// Check if user can manage this tournament // Check if user can manage this tournament
const permission = await canManageTournament(tournamentId) const permission = await canManageTournament(tournamentId)