Skip to content

Commit

Permalink
보드게임 로직 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
enbraining committed Dec 31, 2023
1 parent da99a89 commit 077e7bd
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,15 @@ public void joinBoardgame(UUID id) {

@Override
public void doneBoardgame(UUID boardgameId) {
UUID userId = UUID.fromString(SecurityContextHolder.getContext().getAuthentication().getName());
UUID memberId = UUID.fromString(SecurityContextHolder.getContext().getAuthentication().getName());
Boardgame boardgame = boardgameRepository.findBoardgameById(boardgameId).orElseThrow(BoardgameNotFoundException::new);

Member member = memberRepository.findMemberById(userId);
Member member = memberRepository.findMemberById(memberId);

List<Boardgame> boardgames = member.getBoardgames();
boardgames.remove(boardgame);
member.setBoardgames(boardgames);

memberRepository.save(member);
boardgameRepository.delete(boardgame);
memberRepository.save(member);
}
}

0 comments on commit 077e7bd

Please sign in to comment.