Skip to content

Commit

Permalink
updated sport source
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejFrnka committed Apr 13, 2024
1 parent c875392 commit bda9b94
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@ public UserDTO getUserById(Long id) {
throw new ResponseStatusException(HttpStatus.NOT_FOUND);
}

Set<SportUser> sportUsers = user.get().getSportUsers();
List<Sport> sports = sportUsers.stream().map(SportUser::getSport).toList();

List<EventPlayer> events = new ArrayList<>(user.get().getEventsPlayed());
HashSet<SportDTO> sports = new HashSet<>();
for (EventPlayer e : events) {
rankService.updatePlayersRanks(e.getEvent());
sports.add(sportMapper.toDTO(e.getEvent().getSport()));
}
// HashSet<SportDTO> sports = new HashSet<>();
// for (EventPlayer e : events) {
// rankService.updatePlayersRanks(e.getEvent());
// sports.add(sportMapper.toDTO(e.getEvent().getSport()));
// }

return UserDTO.builder()
.name(user.get().getName())
Expand Down

0 comments on commit bda9b94

Please sign in to comment.