fix: bugfix
This commit is contained in:
@ -108,4 +108,17 @@ public class ProjectService {
|
||||
public void deleteProjectById(Long id) {
|
||||
this.projectRepository.deleteById(id);
|
||||
}
|
||||
|
||||
public Project getProjectByName(String name, boolean noerror) {
|
||||
Optional<Project> project = this.projectRepository.findByProjectName(name);
|
||||
if (project.isEmpty()) {
|
||||
if (noerror) logger.error("No project found with name {}", name);
|
||||
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Ce projet n'existe pas");
|
||||
}
|
||||
return project.get();
|
||||
}
|
||||
|
||||
public Project getProjectByName(String name) {
|
||||
return getProjectByName(name, false);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user