diff --git a/layer-api/src/main/java/org/layer/domain/retrospect/controller/dto/request/RetrospectCreateRequest.java b/layer-api/src/main/java/org/layer/domain/retrospect/controller/dto/request/RetrospectCreateRequest.java index e1a56502..fa23f07e 100644 --- a/layer-api/src/main/java/org/layer/domain/retrospect/controller/dto/request/RetrospectCreateRequest.java +++ b/layer-api/src/main/java/org/layer/domain/retrospect/controller/dto/request/RetrospectCreateRequest.java @@ -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 ) { } diff --git a/layer-api/src/main/java/org/layer/domain/retrospect/service/RetrospectService.java b/layer-api/src/main/java/org/layer/domain/retrospect/service/RetrospectService.java index 8e51f26f..55040e63 100644 --- a/layer-api/src/main/java/org/layer/domain/retrospect/service/RetrospectService.java +++ b/layer-api/src/main/java/org/layer/domain/retrospect/service/RetrospectService.java @@ -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 myQuestions = getQuestions(request.questions(), null, savedForm.getId());