Skip to content

Commit

Permalink
refactor: findPlayerById 재활용하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dooboocookie committed Sep 13, 2023
1 parent 122b637 commit d5018f2
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ public Player create(final CreatePlayerCommand createPlayerCommand) {
public void addScore(final AddScoreCommand addScoreCommand) {
final Long playerId = addScoreCommand.playerId();
final Score score = addScoreCommand.score();
final Player player = playerRepository.findById(playerId)
.orElseThrow(() -> new PlayerException(PLAYER_NOT_FOUND));
final Player player = findPlayerById(playerId);

player.addScore(score);
}
Expand Down

0 comments on commit d5018f2

Please sign in to comment.