show waterlevel for the next days
This commit is contained in:
@@ -5,6 +5,7 @@ use sqlx::SqlitePool;
|
||||
use self::{
|
||||
planned_event::{PlannedEvent, PlannedEventWithUserAndTriptype},
|
||||
trip::{Trip, TripWithUserAndType},
|
||||
waterlevel::Waterlevel,
|
||||
};
|
||||
|
||||
pub mod boat;
|
||||
@@ -27,6 +28,7 @@ pub mod tripdetails;
|
||||
pub mod triptype;
|
||||
pub mod user;
|
||||
pub mod usertrip;
|
||||
pub mod waterlevel;
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
pub struct Day {
|
||||
@@ -34,6 +36,7 @@ pub struct Day {
|
||||
planned_events: Vec<PlannedEventWithUserAndTriptype>,
|
||||
trips: Vec<TripWithUserAndType>,
|
||||
is_pinned: bool,
|
||||
max_waterlevel: Option<i64>,
|
||||
}
|
||||
|
||||
impl Day {
|
||||
@@ -44,6 +47,7 @@ impl Day {
|
||||
planned_events: PlannedEvent::get_pinned_for_day(db, day).await,
|
||||
trips: Trip::get_pinned_for_day(db, day).await,
|
||||
is_pinned,
|
||||
max_waterlevel: Waterlevel::max_waterlevel_for_day(db, day).await,
|
||||
}
|
||||
} else {
|
||||
Self {
|
||||
@@ -51,6 +55,7 @@ impl Day {
|
||||
planned_events: PlannedEvent::get_for_day(db, day).await,
|
||||
trips: Trip::get_for_day(db, day).await,
|
||||
is_pinned,
|
||||
max_waterlevel: Waterlevel::max_waterlevel_for_day(db, day).await,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user