瀏覽代碼

updated destroy method

Leon 5 年之前
父節點
當前提交
c4dfe6cefd
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      src/main/java/com/zipcodewilmington/bakery/Controllers/BakerController.java

+ 1
- 1
src/main/java/com/zipcodewilmington/bakery/Controllers/BakerController.java 查看文件

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