PMT-15: Projekte löschen #11
1 changed files with 10 additions and 0 deletions
|
@ -35,6 +35,16 @@ public class ApiController implements DefaultApi {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Void> deleteProject(Long id) {
|
||||||
|
if (!projectRepository.existsById(id)) {
|
||||||
|
return ResponseEntity.notFound().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
projectRepository.deleteById(id);
|
||||||
|
return ResponseEntity.noContent().build();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseEntity<GetAllProjectsDTO> getAllProjects() {
|
public ResponseEntity<GetAllProjectsDTO> getAllProjects() {
|
||||||
GetAllProjectsDTO response = new GetAllProjectsDTO();
|
GetAllProjectsDTO response = new GetAllProjectsDTO();
|
||||||
|
|
Loading…
Reference in a new issue