Kaynağa Gözat

updated destroy method

Leon 5 yıl önce
ebeveyn
işleme
c4dfe6cefd

+ 1
- 1
src/main/java/com/zipcodewilmington/bakery/Controllers/BakerController.java Dosyayı Görüntüle

30
     }
30
     }
31
 
31
 
32
     public ResponseEntity<Boolean> destroy(Long id) {
32
     public ResponseEntity<Boolean> destroy(Long id) {
33
-        this.bakerRepository.findById(id).get();
33
+        this.bakerRepository.deleteById(id);
34
         return new ResponseEntity<>(true, HttpStatus.OK);
34
         return new ResponseEntity<>(true, HttpStatus.OK);
35
     }
35
     }
36
 }
36
 }