1

Merge remote-tracking branch 'origin/master' into fixSomeErrors

# Conflicts:
#	src/main/java/mops/gruppen2/controller/Gruppen2Controller.java
This commit is contained in:
Lukas Ettel
2020-03-23 13:05:32 +01:00
9 changed files with 55 additions and 13 deletions

View File

@ -167,8 +167,8 @@ public class ControllerService {
eventService.saveEvent(deleteUserEvent);
}
public void deleteGroupEvent(User user, Long groupId) {
DeleteGroupEvent deleteGroupEvent = new DeleteGroupEvent(groupId, user.getId());
public void deleteGroupEvent(String user_id, Long groupId) {
DeleteGroupEvent deleteGroupEvent = new DeleteGroupEvent(groupId, user_id);
eventService.saveEvent(deleteGroupEvent);
}

View File

@ -89,7 +89,7 @@ public class GroupService {
List<Event> eventsUser = getGroupEvents(eventRepository.findGroup_idsWhereUser_id(userId));
List<Group> groups = projectEventList(eventsUser);
List<Group> newGroups = new ArrayList<>();
for (Group group : groups) {
for (Group group : visibleGroups) {
if (group.getMembers().contains(user)) {
newGroups.add(group);
}
@ -102,6 +102,9 @@ public class GroupService {
List<Group> visibleGroups = projectEventList(eventsVisible);
List<Group> visibleLectures = new ArrayList<>();
for (Group group : visibleGroups) {
if(group.getType() == null){
continue;
}
if (group.getType().equals(GroupType.LECTURE)) {
visibleLectures.add(group);
}
@ -121,6 +124,9 @@ public class GroupService {
public List<Group> findGroupWith(String search, Account account) throws EventException {
List<Group> groups = new ArrayList<>();
for (Group group : getAllGroupWithVisibilityPublic(account.getName())) {
if(group.getType() == null){
continue;
}
if (group.getTitle().toLowerCase().contains(search.toLowerCase()) || group.getDescription().toLowerCase().contains(search.toLowerCase())) {
groups.add(group);
}