feat: finished creating services from controllers, continued implementing entrepreneurServiceApi with some validation
This commit is contained in:
@ -34,7 +34,7 @@ public class ProjectService {
|
||||
public Project getProjectById(Long id) {
|
||||
Optional<Project> project = this.projectRepository.findById(id);
|
||||
if (project.isEmpty()) {
|
||||
System.err.println("Project with id " + id + " not found");
|
||||
logger.error("No project found with id {}", id);
|
||||
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Ce projet n'existe pas");
|
||||
}
|
||||
return project.get();
|
||||
@ -77,7 +77,7 @@ public class ProjectService {
|
||||
|
||||
if (projectStatus != null) {
|
||||
if (!validateStatus(projectStatus)) {
|
||||
System.err.println("updateProjectStatus: Invalid status " + projectStatus);
|
||||
logger.error("updateProjectStatus: Invalid status {}", projectStatus);
|
||||
throw new ResponseStatusException(
|
||||
HttpStatus.NOT_ACCEPTABLE, "Ce status n'est pas accepté");
|
||||
}
|
||||
|
Reference in New Issue
Block a user