PMT-15: Added a deleteProject by ID method
This commit is contained in:
parent
e9e58b821e
commit
165aee2ece
1 changed files with 10 additions and 0 deletions
|
@ -35,6 +35,16 @@ public class ApiController implements DefaultApi {
|
|||
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
|
||||
public ResponseEntity<GetAllProjectsDTO> getAllProjects() {
|
||||
GetAllProjectsDTO response = new GetAllProjectsDTO();
|
||||
|
|
Loading…
Reference in a new issue