Seth 5 лет назад
Родитель
Сommit
7701a444ce

+ 4
- 4
src/main/java/com/zipcodewilmington/bakery/Controllers/BakerController.java Просмотреть файл

@@ -29,8 +29,8 @@ public class BakerController {
29 29
         return new ResponseEntity<>(this.bakerRepository.save(baker), HttpStatus.CREATED);
30 30
     }
31 31
 
32
-    @PutMapping("/bakers")
33
-    public ResponseEntity<Baker> update(Long id, Baker baker) {
32
+    @PutMapping("/bakers/{id}")
33
+    public ResponseEntity<Baker> update(@PathVariable Long id, Baker baker) {
34 34
         Baker foundBaker = bakerRepository.findOne(id);
35 35
 
36 36
         foundBaker.setName(baker.getName());
@@ -39,8 +39,8 @@ public class BakerController {
39 39
         return new ResponseEntity<>(this.bakerRepository.save(foundBaker), HttpStatus.OK);
40 40
     }
41 41
 
42
-    @DeleteMapping("/bakers/")
43
-    public ResponseEntity<Boolean> destroy(Long id) {
42
+    @DeleteMapping("/bakers/{id}")
43
+    public ResponseEntity<Boolean> destroy(@PathVariable Long id) {
44 44
         this.bakerRepository.delete(id);
45 45
         return new ResponseEntity<>(true, HttpStatus.OK);
46 46
     }