return new ResponseEntity<String>(headers, HttpStatus.OK);
}
@RequestMapping(value = "/{id}", method = RequestMethod.PUT, headers = "Accept=application/json")
public ResponseEntity<String> updateFromJson(@RequestBody String json, @PathVariable("id") Long id) {
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
Todo todo = Todo.fromJsonToTodo(json.toString());
if (todoService.updateTodo(todo) == null) {
return new ResponseEntity<String>(headers, HttpStatus.NOT_FOUND);
}
return new ResponseEntity<String>(headers, HttpStatus.OK);