diff --git a/app/features/api-public/routes/tournament.$id.teams.ts b/app/features/api-public/routes/tournament.$id.teams.ts index ad38954d5..f7b657203 100644 --- a/app/features/api-public/routes/tournament.$id.teams.ts +++ b/app/features/api-public/routes/tournament.$id.teams.ts @@ -104,6 +104,7 @@ export const loader = async ({ params }: LoaderFunctionArgs) => { ).as("mapPool"), ]) .where("TournamentTeam.tournamentId", "=", id) + .where("TournamentTeam.isPlaceholder", "=", 0) .orderBy("TournamentTeam.createdAt", "asc") .execute(); diff --git a/app/features/api-public/routes/tournament.$id.ts b/app/features/api-public/routes/tournament.$id.ts index fc10e80c2..713892ca6 100644 --- a/app/features/api-public/routes/tournament.$id.ts +++ b/app/features/api-public/routes/tournament.$id.ts @@ -51,7 +51,8 @@ export const loader = async ({ params }: LoaderFunctionArgs) => { .on("TournamentTeamCheckIn.bracketIdx", "is", null), ) .select(["TournamentTeamCheckIn.checkedInAt"]) - .where("TournamentTeam.tournamentId", "=", id), + .where("TournamentTeam.tournamentId", "=", id) + .where("TournamentTeam.isPlaceholder", "=", 0), ).as("teams"), ]) .where("Tournament.id", "=", id) diff --git a/app/features/calendar/CalendarRepository.server.ts b/app/features/calendar/CalendarRepository.server.ts index fff96afe1..375ff07fa 100644 --- a/app/features/calendar/CalendarRepository.server.ts +++ b/app/features/calendar/CalendarRepository.server.ts @@ -147,6 +147,7 @@ const withTeamsCount = ( ), ) .whereRef("TournamentTeam.tournamentId", "=", "Tournament.id") + .where("TournamentTeam.isPlaceholder", "=", 0) .where((eb) => eb.or([ eb("TournamentTeamCheckIn.checkedInAt", "is not", null), diff --git a/app/features/tournament/TournamentRepository.server.ts b/app/features/tournament/TournamentRepository.server.ts index ae7a02e18..31b92cf95 100644 --- a/app/features/tournament/TournamentRepository.server.ts +++ b/app/features/tournament/TournamentRepository.server.ts @@ -338,6 +338,7 @@ export async function findChildTournaments(parentTournamentId: number) { .selectFrom("TournamentTeam") .select(({ fn }) => [fn.countAll().as("teamsCount")]) .whereRef("TournamentTeam.tournamentId", "=", "Tournament.id") + .where("TournamentTeam.isPlaceholder", "=", 0) .as("teamsCount"), jsonArrayFrom( eb @@ -348,7 +349,8 @@ export async function findChildTournaments(parentTournamentId: number) { "TournamentTeam.id", ) .select(["TournamentTeamMember.userId"]) - .whereRef("TournamentTeam.tournamentId", "=", "Tournament.id"), + .whereRef("TournamentTeam.tournamentId", "=", "Tournament.id") + .where("TournamentTeam.isPlaceholder", "=", 0), ).as("teamMembers"), ]) .where("Tournament.parentTournamentId", "=", parentTournamentId)