diff --git a/src/main/java/de/hmmh/pmt/ApiController.java b/src/main/java/de/hmmh/pmt/ApiController.java index 5031841..bc05059 100644 --- a/src/main/java/de/hmmh/pmt/ApiController.java +++ b/src/main/java/de/hmmh/pmt/ApiController.java @@ -35,6 +35,16 @@ public class ApiController implements DefaultApi { return Optional.empty(); } + @Override + public ResponseEntity deleteProject(Long id) { + if (!projectRepository.existsById(id)) { + return ResponseEntity.notFound().build(); + } + + projectRepository.deleteById(id); + return ResponseEntity.noContent().build(); + } + @Override public ResponseEntity getAllProjects() { GetAllProjectsDTO response = new GetAllProjectsDTO();