Fix tournaments always reporting as not saved if placeholder team (in /looking)

This commit is contained in:
Kalle 2026-03-20 17:50:38 +02:00
parent a1d2784a9e
commit 19213056a7
2 changed files with 3 additions and 1 deletions

View File

@ -21,7 +21,7 @@ export const loader = async ({ params }: LoaderFunctionArgs) => {
tournamentId, tournamentId,
userId: user.id, userId: user.id,
}); });
if (!ownTournamentTeam) if (!ownTournamentTeam) {
return { return {
mapPool: null, mapPool: null,
friendPlayers: null, friendPlayers: null,
@ -31,6 +31,7 @@ export const loader = async ({ params }: LoaderFunctionArgs) => {
tournamentId, tournamentId,
}), }),
}; };
}
return { return {
mapPool: findMapPoolByTeamId(ownTournamentTeam.id), mapPool: findMapPoolByTeamId(ownTournamentTeam.id),

View File

@ -16,6 +16,7 @@ const stm = sql.prepare(/*sql*/ `
and "TournamentTeamMember"."isOwner" = 1 and "TournamentTeamMember"."isOwner" = 1
where where
"TournamentTeam"."tournamentId" = @tournamentId "TournamentTeam"."tournamentId" = @tournamentId
and "TournamentTeam"."isPlaceholder" = 0
and "TournamentTeamMember"."userId" = @userId and "TournamentTeamMember"."userId" = @userId
`); `);