only allow guests to register for specific events; don't even show them the other trips
This commit is contained in:
@@ -30,4 +30,21 @@ impl Day {
|
||||
trips: Trip::get_for_day(db, day).await,
|
||||
}
|
||||
}
|
||||
pub async fn new_guest(db: &SqlitePool, day: NaiveDate) -> Self {
|
||||
let mut day = Self::new(db, day).await;
|
||||
|
||||
day.planned_events = day
|
||||
.planned_events
|
||||
.into_iter()
|
||||
.filter(|e| e.planned_event.allow_guests)
|
||||
.collect();
|
||||
|
||||
day.trips = day
|
||||
.trips
|
||||
.into_iter()
|
||||
.filter(|t| t.trip.allow_guests)
|
||||
.collect();
|
||||
|
||||
day
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user