Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ public ToDoResult updateRoutineToDos(ToDo existingToDo, UpdateToDoCommand comman
}

private ToDoResult updateSingleToDo(ToDo existingToDo, UpdateToDoCommand command) {
if (command.routine() != null && !command.routine().equals(existingToDo.getRoutine())) {
createNewRoutineFromDate(command, command.date());
removeRoutineFromToDo();
}
// 단일 투두 수정: 해당 투두만 수정하고 루틴 연결을 제거하여 독립적으로 만듦
existingToDo.updateBy(command);
existingToDo.removeRoutine(); // 루틴 연결 제거하여 단일 투두로 변경
toDoRepository.saveToDo(existingToDo);
return new ToDoResult(existingToDo.getId());
}

Expand Down Expand Up @@ -297,8 +297,9 @@ private void deleteOtherRoutineToDos(String routineId, String excludeToDoId, Str
}
}

private void removeRoutineFromToDo() {
// 루틴 정보 제거 로직 (도메인 메서드 필요)
private void removeRoutineFromToDo(ToDo toDo) {
toDo.removeRoutine();
toDoRepository.saveToDo(toDo);
}

@Override
Expand Down
Loading