Fix a few missing isPlaceholder filters in tournament team queries
Some checks are pending
E2E Tests / e2e (push) Waiting to run
Tests and checks on push / run-checks-and-tests (push) Waiting to run
Updates translation progress / update-translation-progress-issue (push) Waiting to run

This commit is contained in:
Kalle
2026-03-27 20:46:10 +02:00
parent b11cddd86b
commit 48de5654ff
4 changed files with 7 additions and 2 deletions

View File

@@ -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();

View File

@@ -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)

View File

@@ -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),

View File

@@ -338,6 +338,7 @@ export async function findChildTournaments(parentTournamentId: number) {
.selectFrom("TournamentTeam")
.select(({ fn }) => [fn.countAll<number>().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)