adds request attribute users in edit() handler

Tue, 19 May 2020 16:55:58 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 19 May 2020 16:55:58 +0200
changeset 67
d15779cf3982
parent 66
635ae67e73b5
child 68
ded1b5639bd3

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;

mercurial