1

fix-search after leaving group

This commit is contained in:
killerber4t
2020-03-19 14:14:54 +01:00
parent 8291b5c41e
commit 22bfcf3a05
4 changed files with 27 additions and 14 deletions

View File

@ -226,7 +226,9 @@ public class Gruppen2Controller {
@PostMapping("/details/members/changeRole")
public String changeRole(KeycloakAuthenticationToken token, @RequestParam("group_id") Long groupId,
@RequestParam("user_id") String userId) throws EventException {
Account account = keyCloakService.createAccountFromPrincipal(token);
controllerService.updateRole(userId, groupId);
if(userId.equals(account.getName())) return "redirect:/gruppen2/details/" + groupId;
return "redirect:/gruppen2/details/members/" + groupId;
}