Skip to content

Commit

Permalink
[BE] FIX: 아이템 히스토리 조회시 구매일 순으로 정렬해서 반환
Browse files Browse the repository at this point in the history
  • Loading branch information
chyo1 committed Jun 3, 2024
1 parent 0c5cc21 commit 43d13f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Page<ItemHistory> findAllByUserIdOnMinusPriceItemsWithSubQuery(
@Param("userId") Long userId, Pageable pageable);

@EntityGraph(attributePaths = "item")
Page<ItemHistory> findAllByUserId(Long userId, Pageable pageable);
Page<ItemHistory> findAllByUserIdOrderByPurchaseAtDesc(Long userId, Pageable pageable);

@Query("SELECT ih "
+ "FROM ItemHistory ih "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Page<ItemHistory> getItemHistoryWithItem(Long userId, Pageable pageable)
}

public Page<ItemHistory> getItemHistoriesByUserIdWithItem(Long userId, Pageable pageable) {
return itemHistoryRepository.findAllByUserId(userId, pageable);
return itemHistoryRepository.findAllByUserIdOrderByPurchaseAtDesc(userId, pageable);
}

public Page<ItemHistory> getCoinHistory(Long userId, Pageable pageable, List<Long> itemIds) {
Expand Down

0 comments on commit 43d13f2

Please sign in to comment.