Skip to content

Commit

Permalink
feat : 일정이 1개도 없는 유저에게 오류 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
Dayon-Hong committed May 28, 2024
1 parent e609e4a commit dc8a34a
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;

@Slf4j
Expand Down Expand Up @@ -202,7 +199,11 @@ public Country validateCountry(String countryName) {
@Override
public List<LatestCreateResponse> getLatestCreatedSchedules(String uid, int limit) {
Member findMember = validateUserCheck(uid);
List<Schedule> topSchedules = scheduleRepository.findTop5ByMemberOrderByIdDesc(findMember);
List<Schedule> topSchedules = scheduleRepository.findTop5ByMemberOrderByIdDescWithDetails(findMember);

if (topSchedules.isEmpty()) {
throw new ScheduleNotFoundException();
}

List<LatestCreateResponse> responses = new ArrayList<>();
for (Schedule schedule : topSchedules) {
Expand Down

0 comments on commit dc8a34a

Please sign in to comment.