Skip to content

Commit

Permalink
[FIX] @transaction 어노테이션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
EunbeenDev committed Aug 17, 2024
1 parent e8ee8c7 commit 4445a97
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public ResponseEntity<?> createInitialCharacter(UserPrincipal userPrincipal, New
}


@Transactional
public ResponseEntity<?> myCharacterEquipItem(UserPrincipal userPrincipal, MyCharacterEquipItemReq myCharacterEquipItemReq) {
Character character = characterRepository.findByUserId(userPrincipal.getId()).orElseThrow(() -> new IllegalArgumentException("캐릭터를 찾을 수 없습니다."));
List<Item> item = character.getItems();
Expand All @@ -220,6 +221,7 @@ public ResponseEntity<?> myCharacterEquipItem(UserPrincipal userPrincipal, MyCha
Item equitItem = (Item) itemRepository.findById(itemId).orElseThrow(()->new IllegalArgumentException("아이템을 찾을 수 없습니다."));
equitItem.updateEquipped(true);


// // 장착 해제할 아이템 찾기 후 isEquipped = false로 변경
// Item itemToUnequip = item.stream()
// .filter(i -> i.getItemImage().getItemType().equals(itemType) && i.isEquipped())
Expand Down

0 comments on commit 4445a97

Please sign in to comment.