mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-08 02:17:41 +00:00
[SIS-7] only showing confirmed meetups in meetup list command, fixing #7
This commit is contained in:
@@ -61,7 +61,7 @@ public class ListMeetups extends AbstractConditionableCommand {
|
||||
}
|
||||
|
||||
private MessageToSend getMessageToSend(Long serverId) {
|
||||
List<Meetup> meetups = meetupManagementServiceBean.getFutureMeetups();
|
||||
List<Meetup> meetups = meetupManagementServiceBean.getIncomingMeetups();
|
||||
List<MeetupListItemModel> listItems = meetups
|
||||
.stream()
|
||||
.map(MeetupListItemModel::fromMeetup)
|
||||
|
||||
@@ -13,5 +13,6 @@ import java.util.List;
|
||||
public interface MeetupRepository extends JpaRepository<Meetup, ServerSpecificId> {
|
||||
List<Meetup> findByMeetupTimeLessThan(Instant date);
|
||||
List<Meetup> findByMeetupTimeGreaterThan(Instant date);
|
||||
List<Meetup> findByMeetupTimeGreaterThanAndState(Instant date, MeetupState state);
|
||||
List<Meetup> findByState(MeetupState state);
|
||||
}
|
||||
|
||||
@@ -66,6 +66,10 @@ public class MeetupManagementServiceBean {
|
||||
return meetupRepository.findByMeetupTimeGreaterThan(Instant.now());
|
||||
}
|
||||
|
||||
public List<Meetup> getIncomingMeetups() {
|
||||
return meetupRepository.findByMeetupTimeGreaterThanAndState(Instant.now(), MeetupState.CONFIRMED);
|
||||
}
|
||||
|
||||
public void deleteMeetups(List<Meetup> meetups) {
|
||||
meetupRepository.deleteAll(meetups);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user