Skip to content

Commit

Permalink
chore: 회고 수정시 기존 임시답변 있을 경우 삭제 (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekks authored Aug 9, 2024
1 parent cbbf89a commit 27f9efc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ public void update(AnswerListUpdateRequest request, Long spaceId, Long retrospec
answerRepository.findByRetrospectIdAndMemberIdAndAnswerStatusAndQuestionIdIn(retrospectId, memberId,
AnswerStatus.DONE, questionIds));
answers.validateContainAnswers();

// 기존 임시답변 제거
answerRepository.deleteAllByRetrospectIdAndMemberIdAndAnswerStatus(retrospectId, memberId,
AnswerStatus.TEMPORARY);

for (Answer a : answers.getAnswers()) {
// 답변에 해당하는 질문이 존재하지 않을 경우 throw
var foundAnswerRequest = request.requests().stream().filter(it -> it.questionId().equals(a.getQuestionId())).findFirst().orElseThrow(() -> new AnswerException(NOT_ANSWERED));
Expand Down

0 comments on commit 27f9efc

Please sign in to comment.