diff --git a/src/model/planned_event.rs b/src/model/planned_event.rs index d41a3ab..e11d8ff 100644 --- a/src/model/planned_event.rs +++ b/src/model/planned_event.rs @@ -17,13 +17,16 @@ pub struct PlannedEvent { impl PlannedEvent { pub async fn get_for_day(db: &SqlitePool, day: NaiveDate) -> Vec { + let day = format!("{}", day); sqlx::query_as!( PlannedEvent, " SELECT planned_event.id, name, planned_amount_cox, allow_guests, trip_details_id, planned_starting_time, max_people, day, notes FROM planned_event INNER JOIN trip_details ON planned_event.trip_details_id = trip_details.id - " +WHERE day=? + ", + day ) .fetch_all(db) .await