Skip to content

Commit

Permalink
fix: 발송 옵션 조회 -> 옵션과 질문 각각 조회 하는 방식으로 수정중 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
623nana committed Jul 29, 2021
1 parent a329617 commit 9ff9d72
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import static org.springframework.beans.BeanUtils.copyProperties;

import com.nexters.covid.letter.domain.Question;
import com.nexters.covid.letter.domain.SendOption;
import java.util.List;
import lombok.Getter;
import lombok.Setter;

Expand All @@ -14,10 +12,8 @@ public class OptionResponse {

private String text;
private Long covidStat;
private List<Question> questions;

public OptionResponse(SendOption source) {
copyProperties(source, this);
this.questions = source.questions();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class LetterService {
private final SendOptionRepository sendOptionRepository;

public List<OptionResponse> options() {
return sendOptionRepository.findAllJoinFetch()
return sendOptionRepository.findAll()
.stream()
.map(OptionResponse::new)
.collect(Collectors.toList());
Expand Down

0 comments on commit 9ff9d72

Please sign in to comment.