|
@@ -24,12 +24,12 @@ public class MuffinController {
|
24
|
24
|
}
|
25
|
25
|
|
26
|
26
|
@PostMapping(path = "/muffins")
|
27
|
|
- public ResponseEntity<Muffin> create(Muffin muffin) {
|
|
27
|
+ public ResponseEntity<Muffin> create(@RequestBody Muffin muffin) {
|
28
|
28
|
return new ResponseEntity<>(this.muffinRepository.save(muffin), HttpStatus.CREATED);
|
29
|
29
|
}
|
30
|
30
|
|
31
|
31
|
@PutMapping(path = "/muffins/{id}")
|
32
|
|
- public ResponseEntity<Muffin> update(@PathVariable Long id, Muffin muffin) {
|
|
32
|
+ public ResponseEntity<Muffin> update(@PathVariable Long id, @RequestBody Muffin muffin) {
|
33
|
33
|
Muffin foundMuffin = muffinRepository.findOne(id);
|
34
|
34
|
foundMuffin.setFlavor(muffin.getFlavor());
|
35
|
35
|
|