|
|
@@ -25,8 +25,11 @@ public class HomeController {
|
|
25
|
25
|
return new ResponseEntity<>(home, HttpStatus.CREATED);
|
|
26
|
26
|
}
|
|
27
|
27
|
|
|
28
|
|
-// @PutMapping("/people/{id}")
|
|
29
|
|
-// public ResponseEntity<>
|
|
|
28
|
+ @PutMapping(value= "/homes")
|
|
|
29
|
+ public ResponseEntity<Home> updateHome(Home h, Integer id) {
|
|
|
30
|
+ homeService.updateHome(id, h);
|
|
|
31
|
+ return new ResponseEntity<>(HttpStatus.OK);
|
|
|
32
|
+ }
|
|
30
|
33
|
|
|
31
|
34
|
@GetMapping(value = "/homes")
|
|
32
|
35
|
public ResponseEntity<Iterable<Home>> getHomes() {
|
|
|
@@ -34,9 +37,6 @@ public class HomeController {
|
|
34
|
37
|
return new ResponseEntity<>(homes, HttpStatus.OK);
|
|
35
|
38
|
}
|
|
36
|
39
|
|
|
37
|
|
- // these get methods are throwing ambiguous handler methods
|
|
38
|
|
- // Illegal state exception - fixed by specifying URL's better
|
|
39
|
|
-
|
|
40
|
40
|
@GetMapping(value = "/homes/{id}")
|
|
41
|
41
|
public ResponseEntity<Home> getHomeById(@PathVariable Integer id) {
|
|
42
|
42
|
Home h = homeService.findHomeById(id);
|
|
|
@@ -67,5 +67,4 @@ public class HomeController {
|
|
67
|
67
|
Iterable<Person> people = homeService.generatePeopleInHome(homeId);
|
|
68
|
68
|
return new ResponseEntity<>(people, HttpStatus.OK);
|
|
69
|
69
|
}
|
|
70
|
|
-
|
|
71
|
70
|
}
|