be able to auto populate people from planned trip
Some checks failed
CI/CD Pipeline / deploy-staging (push) Has been cancelled
CI/CD Pipeline / deploy-main (push) Has been cancelled
CI/CD Pipeline / test (push) Has been cancelled

This commit is contained in:
2024-08-13 23:02:34 +02:00
parent bb502a4561
commit e55f380c4f
8 changed files with 59 additions and 8 deletions

View File

@ -1,4 +1,4 @@
use chrono::NaiveDate;
use chrono::{Local, NaiveDate};
use serde::Serialize;
use sqlx::SqlitePool;
@ -164,6 +164,11 @@ WHERE trip.id=?
}
}
pub async fn get_for_today(db: &SqlitePool) -> Vec<TripWithUserAndType> {
let today = Local::now().date_naive();
Self::get_for_day(db, today).await
}
pub async fn get_for_day(db: &SqlitePool, day: NaiveDate) -> Vec<TripWithUserAndType> {
let day = format!("{day}");
let trips = sqlx::query_as!(