Enter Match Results
Record match results for {tournament.name}.
Recent Matches
{match.playedAt?.toLocaleDateString()}
{match.team1P1.name} + {match.team1P2.name} vs{" "} {match.team2P1.name} + {match.team2P2.name}
import { prisma } from "@/lib/prisma" export const dynamic = "force-dynamic"; import Navigation from "@/components/Navigation" import Link from "next/link" import { notFound, redirect } from "next/navigation" import { canManageTournament } from "@/lib/permissions" import MatchEditor from "@/components/MatchEditor" interface PageProps { params: { id: string } } export default async function TournamentResultsPage({ params }: PageProps) { // Next.js 16 requires awaiting params const { id } = await params const tournamentId = parseInt(id, 10) if (isNaN(tournamentId)) { notFound() } // Check if user can manage this tournament const permission = await canManageTournament(tournamentId) if (!permission.allowed) { redirect("/auth/login") } const tournament = await prisma.event.findUnique({ where: { id: tournamentId }, }) if (!tournament) { notFound() } const matches = await prisma.match.findMany({ where: { eventId: tournamentId }, include: { team1P1: true, team1P2: true, team2P1: true, team2P2: true, }, orderBy: { playedAt: "desc" }, }) const players = await prisma.player.findMany({ orderBy: { name: "asc" }, }) return (
Record match results for {tournament.name}.
{match.playedAt?.toLocaleDateString()}
{match.team1P1.name} + {match.team1P2.name} vs{" "} {match.team2P1.name} + {match.team2P2.name}