don't allow to join as user if already cox
This commit is contained in:
@ -56,7 +56,7 @@ WHERE day=?",
|
||||
ret
|
||||
}
|
||||
|
||||
pub async fn rower_can_register(db: &SqlitePool, trip_details_id: i64) -> bool {
|
||||
pub async fn is_full(db: &SqlitePool, trip_details_id: i64) -> bool {
|
||||
let amount_currently_registered = sqlx::query!(
|
||||
"SELECT COUNT(*) as count FROM user_trip WHERE trip_details_id = ?",
|
||||
trip_details_id
|
||||
@ -75,7 +75,7 @@ WHERE day=?",
|
||||
.unwrap(); //TODO: fixme
|
||||
let amount_allowed_to_register = amount_allowed_to_register.max_people;
|
||||
|
||||
amount_currently_registered < amount_allowed_to_register
|
||||
amount_currently_registered >= amount_allowed_to_register
|
||||
}
|
||||
|
||||
async fn get_all_cox_for_id(db: &SqlitePool, id: i64) -> Vec<Registration> {
|
||||
|
Reference in New Issue
Block a user