Skip to content

Commit

Permalink
fix: TodoController에서 changeCheck메소드 boolean값 반환
Browse files Browse the repository at this point in the history
  • Loading branch information
jucheolkang committed Jan 26, 2024
1 parent f32b746 commit 0127768
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ public void update(Long id, UpdateDto updateDto) {
}

@Transactional
public void changeCheck(Long id) {
public boolean changeCheck(Long id) {
Todo todo = existId(id);
checkDeleteStatus(todo);
todo.changeCheck(!todo.isTodoCheck());
return todo.isTodoCheck();
}

@Transactional
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/idiot/yesslave/todo/ui/TodoController.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ public ResponseEntity todoUpdate(@PathVariable Long id, @RequestBody UpdateDto u
}

@PostMapping("/{id}")
public ResponseEntity changeCheck(@PathVariable Long id) {
todoService.changeCheck(id);
return ResponseEntity.ok("Todo change successfully");
public boolean changeCheck(@PathVariable Long id) {
return todoService.changeCheck(id);
}

@DeleteMapping("/{id}")
Expand Down

0 comments on commit 0127768

Please sign in to comment.