backend-api #6
@ -77,7 +77,7 @@ public class AdminApiService {
|
||||
// TODO: check if tests are sufficient - peer verification required
|
||||
public void addNewProject(Project project) {
|
||||
project.setIdProject(null);
|
||||
// We remove it from the request to be sure that it will be auto generated
|
||||
// We remove the ID from the request to be sure that it will be auto generated
|
||||
try {
|
||||
this.projectService.getProjectByName(project.getProjectName(), true);
|
||||
throw new ResponseStatusException(HttpStatus.CONFLICT, "Project already exists");
|
||||
@ -87,8 +87,12 @@ public class AdminApiService {
|
||||
}
|
||||
}
|
||||
Project newProject = projectService.addNewProject(project);
|
||||
if (project.getProjectAdministrator() != null) {
|
||||
newProject.getProjectAdministrator().updateListProject(newProject);
|
||||
}
|
||||
if (newProject.getEntrepreneurProposed() != null) {
|
||||
newProject.getEntrepreneurProposed().setProjectProposed(newProject);
|
||||
}
|
||||
newProject
|
||||
.getListEntrepreneurParticipation()
|
||||
.forEach(
|
||||
|
Loading…
x
Reference in New Issue
Block a user