Skip to content

Commit

Permalink
fix: 리뷰 메타데이터 반려견 중복 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
iamjooon2 committed Sep 18, 2023
1 parent 6f77563 commit 7ce4ec6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.transaction.annotation.Transactional;
import zipgo.pet.domain.AgeGroup;
import zipgo.pet.domain.Breed;
import zipgo.pet.domain.Breeds;
import zipgo.pet.domain.repository.BreedRepository;
import zipgo.pet.domain.repository.PetSizeRepository;
import zipgo.petfood.domain.PetFood;
Expand Down Expand Up @@ -113,7 +114,8 @@ public GetReviewMetadataResponse getReviewMetadata() {
}

private List<Metadata> findAllBreeds() {
return breedRepository.findAll().stream()
Breeds breeds = Breeds.from(breedRepository.findAll());
return breeds.getOrderedBreeds().stream()
.map(breed -> new Metadata(breed.getId(), breed.getName()))
.toList();
}
Expand Down

0 comments on commit 7ce4ec6

Please sign in to comment.