This commit is contained in:
2023-05-24 13:11:47 +02:00
parent c91db80ce5
commit 478ce329e3
2 changed files with 7 additions and 5 deletions

View File

@ -34,14 +34,13 @@ pub struct TripWithUserAndType {
impl Trip {
/// Cox decides to create own trip.
pub async fn new_own(db: &SqlitePool, cox: &CoxUser, trip_details: TripDetails) {
sqlx::query!(
let _ = sqlx::query!(
"INSERT INTO trip (cox_id, trip_details_id) VALUES(?, ?)",
cox.id,
trip_details.id
)
.execute(db)
.await
.unwrap(); //Okay, bc. CoxUser + TripDetails can only be created with proper DB backing
.await;
}
pub async fn find_by_id(db: &SqlitePool, id: i64) -> Option<Self> {
@ -99,7 +98,7 @@ WHERE day=?
)
.fetch_all(db)
.await
.unwrap(); //TODO: fixme
.unwrap(); //Okay, as Trip can only be created with proper DB backing
let mut ret = Vec::new();
for trip in trips {