Skip to content

Commit

Permalink
refactor: 리드only 조건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
KarmaPol committed Jan 19, 2024
1 parent eb1b0c8 commit 9217020
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/src/main/java/com/mm/api/Item/service/ItemService.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public ItemResponse createItem(ItemCreateRequest request) {
return ItemResponse.of(savedItem);
}

@Transactional(readOnly = true)
public List<ItemResponse> getItems(Integer page) {
List<Item> items = itemCustomRepository.getItemsByPage(page);

Expand All @@ -44,6 +45,7 @@ public List<ItemResponse> getItems(Integer page) {
.toList();
}

@Transactional(readOnly = true)
public ItemDetailResponse getItemDetail(Long id){
Item item = itemRepository.findById(id)
.orElseThrow(() -> new CustomException(ITEM_NOT_FOUND));
Expand Down

0 comments on commit 9217020

Please sign in to comment.