Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondanythings committed Aug 27, 2024
2 parents 49959f4 + b8be9f4 commit a257c39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ public record RetrospectCreateRequest(
@NotNull
LocalDateTime deadline,
@Schema(description = "질문을 수정한 경우 true", example = "true")
boolean isNewForm,
Boolean isNewForm,
@Schema(description = "질문을 수정한 경우, 변경된 폼 이름", example = "변경된 커스텀 폼 제목")
String formName,
@Schema(description = "질문을 수정한 경우, 변경된 폼 한줄 소개", example = "변경된 커스텀 폼 한줄 소개")
String formIntroduction,
@Schema(description = "질문을 수정한 경우, 현재 form id", example = "3")
Long curFormId
Long curFormId,
@Schema(description = "질문을 수정한 경우, 현재 form id", example = "true")
Boolean hasChangedOriginal
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ public Long createRetrospect(RetrospectCreateRequest request, Long spaceId, Long
}

// 내 회고 폼에 추가
Form form = new Form(memberId, spaceId, request.formName(), request.introduction(), FormType.CUSTOM,
FormTag.CUSTOM);
FormTag formTag = FormTag.CUSTOM;
if (!request.hasChangedOriginal()) {
Form prevForm = formRepository.findByIdOrThrow(request.curFormId());
formTag = prevForm.getFormTag();
}

Form form = new Form(memberId, spaceId, request.formName(), request.introduction(), FormType.CUSTOM, formTag);
Form savedForm = formRepository.save(form);

List<Question> myQuestions = getQuestions(request.questions(), null, savedForm.getId());
Expand Down

0 comments on commit a257c39

Please sign in to comment.