refactor(ui): update components to use new player field names
This commit is contained in:
@@ -40,28 +40,14 @@ export default async function TournamentDetailPage({ params }: PageProps) {
|
||||
player: true,
|
||||
},
|
||||
},
|
||||
teams: {
|
||||
include: {
|
||||
player1: true,
|
||||
player2: true,
|
||||
},
|
||||
},
|
||||
rounds: {
|
||||
include: {
|
||||
bracketMatchups: {
|
||||
include: {
|
||||
team1: {
|
||||
include: {
|
||||
player1: true,
|
||||
player2: true,
|
||||
},
|
||||
},
|
||||
team2: {
|
||||
include: {
|
||||
player1: true,
|
||||
player2: true,
|
||||
},
|
||||
},
|
||||
player1P1: true,
|
||||
player1P2: true,
|
||||
player2P1: true,
|
||||
player2P2: true,
|
||||
match: true,
|
||||
},
|
||||
},
|
||||
@@ -86,28 +72,14 @@ export default async function TournamentDetailPage({ params }: PageProps) {
|
||||
player: true,
|
||||
},
|
||||
},
|
||||
teams: {
|
||||
include: {
|
||||
player1: true,
|
||||
player2: true,
|
||||
},
|
||||
},
|
||||
rounds: {
|
||||
include: {
|
||||
bracketMatchups: {
|
||||
include: {
|
||||
team1: {
|
||||
include: {
|
||||
player1: true,
|
||||
player2: true,
|
||||
},
|
||||
},
|
||||
team2: {
|
||||
include: {
|
||||
player1: true,
|
||||
player2: true,
|
||||
},
|
||||
},
|
||||
player1P1: true,
|
||||
player1P2: true,
|
||||
player2P1: true,
|
||||
player2P2: true,
|
||||
match: true,
|
||||
},
|
||||
},
|
||||
@@ -120,10 +92,10 @@ export default async function TournamentDetailPage({ params }: PageProps) {
|
||||
const matches = await prisma.match.findMany({
|
||||
where: { eventId: tournamentId },
|
||||
include: {
|
||||
team1P1: true,
|
||||
team1P2: true,
|
||||
team2P1: true,
|
||||
team2P2: true,
|
||||
player1P1: true,
|
||||
player1P2: true,
|
||||
player2P1: true,
|
||||
player2P2: true,
|
||||
},
|
||||
orderBy: { playedAt: "desc" },
|
||||
})
|
||||
@@ -204,12 +176,6 @@ export default async function TournamentDetailPage({ params }: PageProps) {
|
||||
{tournament.participants.length}
|
||||
</p>
|
||||
</div>
|
||||
<div className="bg-gray-50 rounded-lg p-4 text-center">
|
||||
<p className="text-sm text-gray-500">Teams</p>
|
||||
<p className="text-2xl font-bold text-gray-900">
|
||||
{tournament.teams.length}
|
||||
</p>
|
||||
</div>
|
||||
<div className="bg-gray-50 rounded-lg p-4 text-center">
|
||||
<p className="text-sm text-gray-500">Rounds</p>
|
||||
<p className="text-2xl font-bold text-gray-900">
|
||||
@@ -217,7 +183,7 @@ export default async function TournamentDetailPage({ params }: PageProps) {
|
||||
</p>
|
||||
</div>
|
||||
<div className="bg-gray-50 rounded-lg p-4 text-center">
|
||||
<p className="text-sm text-gray-500">Matches</p>
|
||||
<p className="text-sm text-gray-500">Matchups</p>
|
||||
<p className="text-2xl font-bold text-gray-900">
|
||||
{matches.length}
|
||||
</p>
|
||||
@@ -287,7 +253,6 @@ export default async function TournamentDetailPage({ params }: PageProps) {
|
||||
{/* Teams Section */}
|
||||
<TeamsSection
|
||||
tournamentId={tournament.id}
|
||||
teams={tournament.teams}
|
||||
participants={tournament.participants.map(p => ({
|
||||
id: p.player.id,
|
||||
name: p.player.name,
|
||||
@@ -317,8 +282,8 @@ export default async function TournamentDetailPage({ params }: PageProps) {
|
||||
{match.playedAt?.toLocaleDateString()}
|
||||
</p>
|
||||
<p className="font-medium">
|
||||
{match.team1P1.name} + {match.team1P2.name} vs{" "}
|
||||
{match.team2P1.name} + {match.team2P2.name}
|
||||
{match.player1P1?.name} + {match.player1P2?.name} vs{" "}
|
||||
{match.player2P1?.name} + {match.player2P2?.name}
|
||||
</p>
|
||||
</div>
|
||||
<div className="text-right">
|
||||
|
||||
Reference in New Issue
Block a user