diff --git a/src/main/java/com/solucitation/midpoint_backend/domain/FavPlace/service/FavPlaceService.java b/src/main/java/com/solucitation/midpoint_backend/domain/FavPlace/service/FavPlaceService.java index 02b51e5..9b17852 100644 --- a/src/main/java/com/solucitation/midpoint_backend/domain/FavPlace/service/FavPlaceService.java +++ b/src/main/java/com/solucitation/midpoint_backend/domain/FavPlace/service/FavPlaceService.java @@ -76,7 +76,6 @@ public FavPlace getFavoritePlaceDetails(FavPlace.AddrType addrType, String email @Transactional(readOnly = true) public List getAllFavoritePlaces(String email) { - // 회원 조회 Member member = memberRepository.findByEmail(email) .orElseThrow(() -> new IllegalArgumentException("해당 이메일의 회원이 존재하지 않습니다.")); @@ -84,9 +83,12 @@ public List getAllFavoritePlaces(String email) { Map responseMap = new HashMap<>(); + responseMap.put(FavPlace.AddrType.HOME, new FavPlaceResponse(null, null, FavPlace.AddrType.HOME.name())); + responseMap.put(FavPlace.AddrType.WORK, new FavPlaceResponse(null, null, FavPlace.AddrType.WORK.name())); + for (FavPlace favPlace : favPlaces) { FavPlace.AddrType addrType = favPlace.getAddrType(); - if (!responseMap.containsKey(addrType)) { + if (responseMap.containsKey(addrType)) { responseMap.put(addrType, new FavPlaceResponse( favPlace.getFavPlaceId(), favPlace.getAddr(),