diff --git a/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java b/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java index bdf067c1..1a60a4d9 100644 --- a/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java +++ b/layer-api/src/main/java/org/layer/domain/answer/service/AnswerService.java @@ -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));