Fixed bug when booking form did not reflect canceled bookings.
This commit is contained in:
@@ -35,7 +35,9 @@ cfg_if! { if #[cfg(feature = "ssr")] {
|
|||||||
|
|
||||||
async fn reservations_for_day(day: &NaiveDate) -> Result<Vec<Reservation>, ServerFnError> {
|
async fn reservations_for_day(day: &NaiveDate) -> Result<Vec<Reservation>, ServerFnError> {
|
||||||
let pool = get_pool().await?;
|
let pool = get_pool().await?;
|
||||||
let reservations = query_as::<_, Reservation>("SELECT * FROM reservation JOIN reservation_sum on reservation.summary=reservation_sum.id WHERE reservation_sum.date=$1")
|
let reservations = query_as::<_, Reservation>("SELECT * FROM reservation \
|
||||||
|
JOIN reservation_sum on reservation.summary=reservation_sum.id \
|
||||||
|
WHERE reservation_sum.date=$1 AND reservation_sum.state <> 'Canceled'")
|
||||||
.bind(day)
|
.bind(day)
|
||||||
.fetch_all(&pool)
|
.fetch_all(&pool)
|
||||||
.await;
|
.await;
|
||||||
|
|||||||
Reference in New Issue
Block a user