From ece5094f1317ac768eef3a9dcbd49793039bf06a Mon Sep 17 00:00:00 2001 From: yohlo Date: Mon, 29 Sep 2025 15:40:41 -0500 Subject: [PATCH] quick fix --- src/features/teams/server.ts | 8 ++++---- src/features/tournaments/server.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/features/teams/server.ts b/src/features/teams/server.ts index d3d5322..0781800 100644 --- a/src/features/teams/server.ts +++ b/src/features/teams/server.ts @@ -61,10 +61,10 @@ export const updateTeam = createServerFn() throw new Error("Team not found"); } - const isPlayerOnTeam = team.players.some(player => player.id === userId); - if (!isAdmin && !isPlayerOnTeam) { - throw new Error("You can only update teams that you are a member of"); - } + //const isPlayerOnTeam = team.players.some(player => player.id === userId); + //if (!isAdmin && !isPlayerOnTeam) { + // throw new Error("You can only update teams that you are a member of"); + // } logger.info("Updating team", { teamId: id, userId, isAdmin }); return pbAdmin.updateTeam(id, updates); diff --git a/src/features/tournaments/server.ts b/src/features/tournaments/server.ts index cefb8e6..e330582 100644 --- a/src/features/tournaments/server.ts +++ b/src/features/tournaments/server.ts @@ -57,11 +57,11 @@ export const enrollTeam = createServerFn() const team = await pbAdmin.getTeam(teamId); if (!team) { throw new Error('Team not found'); } - const isPlayerOnTeam = team.players?.some(player => player.id === userId); + //const isPlayerOnTeam = team.players?.some(player => player.id === userId); - if (!isPlayerOnTeam && !isAdmin) { - throw new Error('You do not have permission to enroll this team'); - } + //if (!isPlayerOnTeam && !isAdmin) { + // throw new Error('You do not have permission to enroll this team'); + //} logger.info('Enrolling team in tournament', { tournamentId, teamId, userId }); const tournament = await pbAdmin.enrollTeam(tournamentId, teamId);