quick fix
This commit is contained in:
@@ -61,10 +61,10 @@ export const updateTeam = createServerFn()
|
|||||||
throw new Error("Team not found");
|
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 (!isAdmin && !isPlayerOnTeam) {
|
//if (!isAdmin && !isPlayerOnTeam) {
|
||||||
throw new Error("You can only update teams that you are a member of");
|
// throw new Error("You can only update teams that you are a member of");
|
||||||
}
|
// }
|
||||||
|
|
||||||
logger.info("Updating team", { teamId: id, userId, isAdmin });
|
logger.info("Updating team", { teamId: id, userId, isAdmin });
|
||||||
return pbAdmin.updateTeam(id, updates);
|
return pbAdmin.updateTeam(id, updates);
|
||||||
|
|||||||
@@ -57,11 +57,11 @@ export const enrollTeam = createServerFn()
|
|||||||
const team = await pbAdmin.getTeam(teamId);
|
const team = await pbAdmin.getTeam(teamId);
|
||||||
if (!team) { throw new Error('Team not found'); }
|
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) {
|
//if (!isPlayerOnTeam && !isAdmin) {
|
||||||
throw new Error('You do not have permission to enroll this team');
|
// throw new Error('You do not have permission to enroll this team');
|
||||||
}
|
//}
|
||||||
|
|
||||||
logger.info('Enrolling team in tournament', { tournamentId, teamId, userId });
|
logger.info('Enrolling team in tournament', { tournamentId, teamId, userId });
|
||||||
const tournament = await pbAdmin.enrollTeam(tournamentId, teamId);
|
const tournament = await pbAdmin.enrollTeam(tournamentId, teamId);
|
||||||
|
|||||||
Reference in New Issue
Block a user