Skip to content

Commit

Permalink
[feature/#204] 연혁 조회 날짜 역순 정렬
Browse files Browse the repository at this point in the history
  • Loading branch information
whitem4rk committed Jan 6, 2024
1 parent 6172670 commit 425d434
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.inhabas.api.domain.club.dto.SaveClubHistoryDto;
import com.inhabas.api.domain.club.repository.ClubHistoryRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

Expand Down Expand Up @@ -58,7 +59,8 @@ public ClubHistoryDto findClubHistory(Long clubHistoryId) {
@Transactional(readOnly = true)
public List<ClubHistoryDto> getClubHistories() {

List<ClubHistory> clubHistoryList = clubHistoryRepository.findAll();
Sort sort = Sort.by(Sort.Direction.DESC, "dateHistory");
List<ClubHistory> clubHistoryList = clubHistoryRepository.findAll(sort);

return clubHistoryList.stream()
.map(ClubHistoryDto::new)
Expand Down

0 comments on commit 425d434

Please sign in to comment.