From 2474a0581d7737758ceb93ea3fa62da45a7bd809 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 28 Apr 2024 13:21:16 +0300 Subject: [PATCH] Show team logo on tournaments even after team disbands Closes #1722 --- app/features/tournament/TournamentRepository.server.ts | 9 +++++---- app/features/tournament/routes/to.$id.teams.$tid.tsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/features/tournament/TournamentRepository.server.ts b/app/features/tournament/TournamentRepository.server.ts index c2d316e6f..a8a4273be 100644 --- a/app/features/tournament/TournamentRepository.server.ts +++ b/app/features/tournament/TournamentRepository.server.ts @@ -125,16 +125,17 @@ export async function findById(id: number) { ).as("mapPool"), jsonObjectFrom( innerEb - .selectFrom("Team") + .selectFrom("AllTeam") .leftJoin( "UserSubmittedImage", - "Team.avatarImgId", + "AllTeam.avatarImgId", "UserSubmittedImage.id", ) - .whereRef("Team.id", "=", "TournamentTeam.teamId") + .whereRef("AllTeam.id", "=", "TournamentTeam.teamId") .select([ - "Team.customUrl", + "AllTeam.customUrl", "UserSubmittedImage.url as logoUrl", + "AllTeam.deletedAt", ]), ).as("team"), ]) diff --git a/app/features/tournament/routes/to.$id.teams.$tid.tsx b/app/features/tournament/routes/to.$id.teams.$tid.tsx index 9f2c57f82..826cd87a0 100644 --- a/app/features/tournament/routes/to.$id.teams.$tid.tsx +++ b/app/features/tournament/routes/to.$id.teams.$tid.tsx @@ -68,7 +68,7 @@ export default function TournamentTeamPage() { : undefined } /> - {team.team ? ( + {team.team && !team.team.deletedAt ? (