Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ out/

### properties ###
*.properties

application.yml
5 changes: 3 additions & 2 deletions src/main/java/org/example/expert/domain/todo/entity/Todo.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
@Table(name = "todos")
public class Todo extends Timestamped {

@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String title;
private String contents;
Expand All @@ -30,7 +31,7 @@ public class Todo extends Timestamped {
@OneToMany(mappedBy = "todo", cascade = CascadeType.REMOVE)
private List<Comment> comments = new ArrayList<>();

@OneToMany(mappedBy = "todo")
@OneToMany(mappedBy = "todo", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Manager> managers = new ArrayList<>();

public Todo(String title, String contents, String weather, User user) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class TodoService {

private final TodoRepository todoRepository;
private final WeatherClient weatherClient;

@Transactional
public TodoSaveResponse saveTodo(AuthUser authUser, TodoSaveRequest todoSaveRequest) {
User user = User.fromAuthUser(authUser);

Expand Down