This commit is contained in:
Viktoria committed 2022-08-29 17:19:49 +02:00
1 parent b52e056868
commit f9ed15a306
2 files changed
+15

No files matched your search

@@ -128,6 +128,16 @@ public class ProjectController {
return modelAndView;
}
@GetMapping("/{projectId}/requests")
public ModelAndView getAllRequestsForProject(@PathVariable("projectId") Long projectId) {
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("participants", projectService.getAllRequestsForProject(projectId));
modelAndView.setViewName("project");
return modelAndView;
}
@PostMapping("/{projectId}/{nameOfPosition}/applay")
public ModelAndView applayOnProject(@PathVariable("projectId") Long projectId,
@PathVariable("nameOfPosition") String nameOfPosition,
@@ -87,6 +87,11 @@ public class ProjectService {
return projectRepo.save(project);
}
public List<Participant> getAllRequestsForProject(Long projectId) {
Project project = getProjectById(projectId);
return project.getParticipants();
}
public Object confirmParticipant(Long projectId, String nameOfPosition, Long participantId, Principal principal) {
Project project = getProjectById(projectId);