Push
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user