diff --git a/src/main/java/com/coniverse/dangjang/domain/guide/exercise/service/ExerciseGuideGenerateService.java b/src/main/java/com/coniverse/dangjang/domain/guide/exercise/service/ExerciseGuideGenerateService.java index 5c49d24c..e8ad4e9e 100644 --- a/src/main/java/com/coniverse/dangjang/domain/guide/exercise/service/ExerciseGuideGenerateService.java +++ b/src/main/java/com/coniverse/dangjang/domain/guide/exercise/service/ExerciseGuideGenerateService.java @@ -71,13 +71,14 @@ public GuideResponse createGuide(AnalysisData analysisData) { walkGuideContent.getGuideLastWeek(), walkGuideContent.getGuideTTS(), exerciseAnalysisData.getUnit()); return exerciseGuideMapper.toResponse(exerciseGuideRepository.save(existExerciseGuide)); } - } - ExerciseCalorie exerciseCalorie = new ExerciseCalorie(exerciseAnalysisData.getType(), exerciseAnalysisData.getCalorie(), - exerciseAnalysisData.getUnit()); - //운동 추가 - if (!existExerciseGuide.isDuplicateAboutExerciseCalories(exerciseCalorie)) { - existExerciseGuide.changeExerciseCalories(exerciseCalorie); - return exerciseGuideMapper.toResponse(exerciseGuideRepository.save(existExerciseGuide)); + } else { + ExerciseCalorie exerciseCalorie = new ExerciseCalorie(exerciseAnalysisData.getType(), exerciseAnalysisData.getCalorie(), + exerciseAnalysisData.getUnit()); + //운동 추가 + if (!existExerciseGuide.isDuplicateAboutExerciseCalories(exerciseCalorie)) { + existExerciseGuide.changeExerciseCalories(exerciseCalorie); + return exerciseGuideMapper.toResponse(exerciseGuideRepository.save(existExerciseGuide)); + } } return exerciseGuideMapper.toResponse(existExerciseGuide); }