1

fix for merge

This commit is contained in:
killerber4t
2020-03-18 17:01:33 +01:00
parent b3107c98f1
commit d2c1de7c9f
3 changed files with 7 additions and 14 deletions

View File

@ -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<User> 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";
}
}

View File

@ -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<User> users) {
public void createLecture(Account account, String title, String description, Boolean visibility, List<User> 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);
}

View File

@ -21,13 +21,11 @@
<li>
<a th:href="@{/gruppen2/findGroup}" href="/findGroup">Suche</a>
</li>
</ul>
<!-- Fix double point -->
<li th:if="${account.getRoles().contains('orga')}">
<a th:href="@{/gruppen2/createLecture}" href="/createLecture">Veranstaltung</a>
</li>
</ul>
</nav>
</header>
<main th:fragment="bodycontent">