diff --git a/src/main/java/mops/gruppen2/controller/Gruppen2Controller.java b/src/main/java/mops/gruppen2/controller/Gruppen2Controller.java index 1dab295..25faa42 100644 --- a/src/main/java/mops/gruppen2/controller/Gruppen2Controller.java +++ b/src/main/java/mops/gruppen2/controller/Gruppen2Controller.java @@ -82,7 +82,7 @@ public class Gruppen2Controller { @RequestParam(value = "title") String title, @RequestParam(value = "beschreibung") String beschreibung, @RequestParam(value = "visibility", required = false) Boolean visibility, - @RequestParam("file") MultipartFile file) throws IOException { + @RequestParam(value = "file") MultipartFile file) throws IOException, EventException { Account account = keyCloakService.createAccountFromPrincipal(token); List userList = CsvService.read(file.getInputStream()); @@ -219,10 +219,10 @@ public class Gruppen2Controller { @RequestParam (value = "user_id") String user_id) throws EventException { controllerService.deleteUser(user_id, group_id); return "redirect:/gruppen2/details/members/" + group_id; + } @GetMapping("*") public String defaultLink() { return "errorRenameLater"; - } } diff --git a/src/main/java/mops/gruppen2/service/ControllerService.java b/src/main/java/mops/gruppen2/service/ControllerService.java index 6cb5e2c..7f84660 100644 --- a/src/main/java/mops/gruppen2/service/ControllerService.java +++ b/src/main/java/mops/gruppen2/service/ControllerService.java @@ -7,12 +7,6 @@ import mops.gruppen2.domain.event.*; import mops.gruppen2.security.Account; import org.springframework.stereotype.Service; -import mops.gruppen2.domain.event.*; -import mops.gruppen2.security.Account; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.UUID; @@ -25,8 +19,9 @@ public class ControllerService { private final UserService userService; private final InviteLinkRepositoryService inviteLinkRepositoryService; - public ControllerService(EventService eventService, InviteLinkRepositoryService inviteLinkRepositoryService) { + public ControllerService(EventService eventService, UserService userService, InviteLinkRepositoryService inviteLinkRepositoryService) { this.eventService = eventService; + this.userService = userService; this.inviteLinkRepositoryService = inviteLinkRepositoryService; } @@ -117,9 +112,9 @@ public class ControllerService { public void deleteGroupEvent(User user, Long group_id) { DeleteGroupEvent deleteGroupEvent = new DeleteGroupEvent(group_id, user.getUser_id()); eventService.saveEvent(deleteGroupEvent); + } - - public void createLecture(Account account, String title, String description, Boolean visibility, List users) { + public void createLecture(Account account, String title, String description, Boolean visibility, List users) throws EventException { Visibility visibility1; Long group_id = eventService.checkGroup(); @@ -135,7 +130,7 @@ public class ControllerService { addUser(account, group_id); updateTitle(account, group_id, title); updateDescription(account, group_id, description); - updateRole(account, group_id); + updateRole(account.getName(), group_id); addUserList(users, group_id); } diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index c55c763..5d51236 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -21,13 +21,11 @@
  • Suche
  • -
  • Veranstaltung
  • -