Tue, 19 May 2020 16:55:58 +0200
adds request attribute users in edit() handler
src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java | file | annotate | diff | comparison | revisions |
--- a/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java Tue May 19 16:51:08 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java Tue May 19 16:55:58 2020 +0200 @@ -96,10 +96,10 @@ @RequestMapping(requestPath = "edit", method = HttpMethod.GET) public ResponseType edit(HttpServletRequest req, DataAccessObjects dao) throws SQLException { - final var projectDao = dao.getProjectDao(); + req.setAttribute("project", findByParameter(req, Integer.class, "id", + dao.getProjectDao()::find).orElse(new Project(-1))); + req.setAttribute("users", dao.getUserDao().list()); - req.setAttribute("project", findByParameter(req, Integer.class, "id", - projectDao::find).orElse(new Project(-1))); setDynamicFragment(req, "project-form"); return ResponseType.HTML;