diff --git a/src/model/mod.rs b/src/model/mod.rs index b18a4cd..b42ed2d 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -22,7 +22,7 @@ pub mod triptype; pub mod user; pub mod usertrip; -#[derive(Serialize)] +#[derive(Serialize, Debug)] pub struct Day { day: NaiveDate, planned_events: Vec, diff --git a/src/model/planned_event.rs b/src/model/planned_event.rs index 8be4258..a1c0bf1 100644 --- a/src/model/planned_event.rs +++ b/src/model/planned_event.rs @@ -144,7 +144,7 @@ WHERE day=?", let mut ret = Vec::new(); for event in events { - let cox = Registration::all_cox(db, event.trip_details_id).await; + let cox = Registration::all_cox(db, event.id).await; let mut trip_type = None; if let Some(trip_type_id) = event.trip_type_id { trip_type = TripType::find_by_id(db, trip_type_id).await; diff --git a/src/model/trip.rs b/src/model/trip.rs index 2eba4ae..07adefa 100644 --- a/src/model/trip.rs +++ b/src/model/trip.rs @@ -25,7 +25,7 @@ pub struct Trip { is_locked: bool, } -#[derive(Serialize)] +#[derive(Serialize, Debug)] pub struct TripWithUserAndType { #[serde(flatten)] pub trip: Trip, diff --git a/src/tera/mod.rs b/src/tera/mod.rs index 8cd4612..c917262 100644 --- a/src/tera/mod.rs +++ b/src/tera/mod.rs @@ -57,7 +57,7 @@ async fn index(db: &State, user: User, flash: Option