Skip to content

Commit

Permalink
Fix tournament leaderboard error
Browse files Browse the repository at this point in the history
  • Loading branch information
Alputer committed Jan 27, 2024
1 parent 6453c1b commit 33718c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/services/leaderboard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ export class LeaderboardService {
public async getTournamentLeaderboard(username: string) {
const user = await this.userRepository.findUserByUsername(username);

if (user.currGroupId === '') {
throw new BadRequestException(
'User did not participate in any tournament yet',
);
}

const membersSorted =
await this.tournamentGroupRepository.getGroupMembersByGroupId(
user.currGroupId,
Expand Down

0 comments on commit 33718c0

Please sign in to comment.