Skip to content

Commit

Permalink
✨ Feature/#149 - 사용한 식권 맨 아래로 정렬 (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
dongkyeomjang authored Nov 23, 2024
1 parent 9df6c95 commit a9cc3f9
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 @@ -40,7 +40,7 @@ public ReadTicketResponseDto execute(
User user = userRepository.findById(accountId)
.orElseThrow(() -> new CommonException(ErrorCode.NOT_FOUND_RESOURCE));

Page<Ticket> ticketsPage = ticketRepository.findByUserOrderByExpirationDateAsc(user, pageable);
Page<Ticket> ticketsPage = ticketRepository.findByUserOrderByIsValidateDescExpirationDateAsc(user, pageable);

// dto로 변환
List<ReadTicketResponseDto.TicketDto> ticketDtos = ticketsPage.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public interface TicketRepository extends JpaRepository<Ticket, Long> {

// user로 Ticket 조회, expirationDate를 ASC로 정렬
Page<Ticket> findByUserOrderByExpirationDateAsc(User user, Pageable pageable);
Page<Ticket> findByUserOrderByIsValidateDescExpirationDateAsc(User user, Pageable pageable);

// user로 Ticket 수 조회
Long countByUser(User user);
Expand Down

0 comments on commit a9cc3f9

Please sign in to comment.