Fix filter in stream to find public lectures
Co-Authored-By: andibuls <andibuls@users.noreply.github.com> Co-Authored-By: tomvahl <tomvahl@users.noreply.github.com> Co-Authored-By: Talha Caliskan <killerber4t@users.noreply.github.com>
This commit is contained in:
@ -1,6 +1,8 @@
|
|||||||
package mops.gruppen2.service;
|
package mops.gruppen2.service;
|
||||||
|
|
||||||
import mops.gruppen2.domain.Group;
|
import mops.gruppen2.domain.Group;
|
||||||
|
import mops.gruppen2.domain.GroupType;
|
||||||
|
import mops.gruppen2.domain.Visibility;
|
||||||
import mops.gruppen2.domain.dto.EventDTO;
|
import mops.gruppen2.domain.dto.EventDTO;
|
||||||
import mops.gruppen2.domain.event.Event;
|
import mops.gruppen2.domain.event.Event;
|
||||||
import mops.gruppen2.domain.exception.EventException;
|
import mops.gruppen2.domain.exception.EventException;
|
||||||
@ -95,7 +97,8 @@ public class GroupService {
|
|||||||
List<Group> visibleGroups = projectEventList(createEvents);
|
List<Group> visibleGroups = projectEventList(createEvents);
|
||||||
|
|
||||||
return visibleGroups.parallelStream()
|
return visibleGroups.parallelStream()
|
||||||
.filter(group -> group.getType() != null)
|
.filter(group -> group.getType() == GroupType.LECTURE)
|
||||||
|
.filter(group -> group.getVisibility() == Visibility.PUBLIC)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user