1

Add template for detailsNoMember.html, that displays the details when you search a page.

Add connection to the controller
This commit is contained in:
kasch309
2020-03-16 13:31:51 +01:00
parent f4ad729efd
commit 54d5028693
3 changed files with 46 additions and 13 deletions

View File

@ -112,4 +112,16 @@ public class Gruppen2Controller {
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Group not found");
}
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
@GetMapping("/detailsSearch")
public String showGroupDetailsNoMember (KeycloakAuthenticationToken token, Model model, @RequestParam (value="id") Long id) throws EventException {
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
Group group = userService.getGroupById(id);
if (group!=null) {
model.addAttribute("group", group);
return "detailsNoMember";
}
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Group not found");
}
}