This commit is contained in:
philipp 2023-04-04 12:23:41 +02:00
parent 3d907487a1
commit 0bdd073d7f

View File

@ -17,13 +17,16 @@ pub struct PlannedEvent {
impl PlannedEvent {
pub async fn get_for_day(db: &SqlitePool, day: NaiveDate) -> Vec<Self> {
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