move todos to gitlab; write tests for /cox/remove/<id>; Closes #9
This commit is contained in:
@ -154,7 +154,7 @@ FROM user_trip WHERE trip_details_id = (SELECT trip_details_id FROM trip WHERE i
|
||||
.await
|
||||
.unwrap(); //Okay, as trip can only be created with proper DB backing
|
||||
let Some(trip_details_id) = trip_details.id else {
|
||||
return Err(TripUpdateError::TripDetailsDoesNotExist); //TODO: Remove?
|
||||
return Err(TripUpdateError::TripDetailsDoesNotExist); //TODO: Remove?
|
||||
};
|
||||
|
||||
sqlx::query!(
|
||||
@ -176,7 +176,7 @@ FROM user_trip WHERE trip_details_id = (SELECT trip_details_id FROM trip WHERE i
|
||||
db: &SqlitePool,
|
||||
cox: &CoxUser,
|
||||
planned_event: &PlannedEvent,
|
||||
) {
|
||||
) -> bool {
|
||||
sqlx::query!(
|
||||
"DELETE FROM trip WHERE cox_id = ? AND planned_event_id = ?",
|
||||
cox.id,
|
||||
@ -184,7 +184,9 @@ FROM user_trip WHERE trip_details_id = (SELECT trip_details_id FROM trip WHERE i
|
||||
)
|
||||
.execute(db)
|
||||
.await
|
||||
.unwrap(); //TODO: handle case where cox is not registered
|
||||
.unwrap()
|
||||
.rows_affected()
|
||||
> 0
|
||||
}
|
||||
|
||||
pub(crate) async fn delete(
|
||||
|
Reference in New Issue
Block a user