push
This commit is contained in:
@ -63,14 +63,7 @@ WHERE id like ?
|
||||
.unwrap(); //TODO: fixme
|
||||
let amount_currently_registered = i64::from(amount_currently_registered.count);
|
||||
|
||||
let amount_allowed_to_register =
|
||||
sqlx::query!("SELECT max_people FROM trip_details WHERE id = ?", self.id)
|
||||
.fetch_one(db)
|
||||
.await
|
||||
.unwrap(); //Okay, TripDetails can only be created if self.id exists
|
||||
let amount_allowed_to_register = amount_allowed_to_register.max_people;
|
||||
|
||||
amount_currently_registered >= amount_allowed_to_register
|
||||
amount_currently_registered >= self.max_people
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user