fix: validate tournament ID parsing for Prisma v7 strict type checking
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user