Compare commits

..

3 Commits

Author SHA1 Message Date
70e209f1ce Merge pull request 'cleaner-code' (#91) from cleaner-code into staging
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m54s
CI/CD Pipeline / deploy-staging (push) Successful in 14m35s
CI/CD Pipeline / deploy-main (push) Has been skipped
Reviewed-on: #91
2023-12-01 10:10:55 +01:00
e081c7a31f cleaner code
All checks were successful
CI/CD Pipeline / test (push) Successful in 11m28s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Has been skipped
2023-12-01 10:10:18 +01:00
7193760f05 Merge pull request 'cleaner code thanks to clippy' (#90) from cleaner-code into main
All checks were successful
CI/CD Pipeline / test (push) Successful in 10m52s
CI/CD Pipeline / deploy-staging (push) Has been skipped
CI/CD Pipeline / deploy-main (push) Successful in 14m16s
Reviewed-on: #90
2023-11-27 12:51:23 +01:00

View File

@ -76,10 +76,6 @@ WHERE trip.id=?
return Err(CoxHelpError::DetailsLocked);
}
if planned_event.is_rower_registered(db, cox).await {
return Err(CoxHelpError::AlreadyRegisteredAsRower);
}
match sqlx::query!(
"INSERT INTO trip (cox_id, planned_event_id) VALUES(?, ?)",
cox.id,
@ -140,14 +136,7 @@ WHERE day=?
return Err(TripUpdateError::NotYourTrip);
}
let trip_details = sqlx::query!(
"SELECT trip_details_id as id FROM trip WHERE id = ?",
trip.id
)
.fetch_one(db)
.await
.unwrap(); //Okay, as trip can only be created with proper DB backing
let Some(trip_details_id) = trip_details.id else {
let Some(trip_details_id) = trip.trip_details_id else {
return Err(TripUpdateError::TripDetailsDoesNotExist); //TODO: Remove?
};