Skip to content

Commit

Permalink
Merge pull request #122 from Team-Shaka/develop
Browse files Browse the repository at this point in the history
Briefing v1 목록 조회 버그 반영
  • Loading branch information
swa07016 authored Dec 24, 2023
2 parents f482fdd + 470c125 commit fe597d1
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

Expand All @@ -22,7 +23,10 @@ public List<Briefing> findBriefings(BriefingRequestParam.BriefingPreviewListPara
final LocalDateTime endDateTime = params.getDate().atTime(LocalTime.MAX);

List<Briefing> briefingList = briefingRepository.findAllByTypeAndCreatedAtBetweenOrderByRanks(params.getType(), startDateTime, endDateTime);
if(briefingList.isEmpty()) return briefingRepository.findTop10ByTypeOrderByCreatedAtDesc(BriefingType.SOCIAL);
if(briefingList.isEmpty()) {
briefingList = briefingRepository.findTop10ByTypeOrderByCreatedAtDesc(BriefingType.SOCIAL);
Collections.reverse(briefingList);
}
return briefingList;
}

Expand Down

0 comments on commit fe597d1

Please sign in to comment.