@@ -1145,11 +1145,20 @@ async fn cancel_booking(
11451145 . await
11461146 . unwrap_or ( None ) ;
11471147
1148- let ( bid, uid, guest_name, guest_email, start_at, end_at, event_title, _account_id, guest_timezone) =
1149- match booking {
1150- Some ( b) => b,
1151- None => return Redirect :: to ( "/dashboard/bookings" ) . into_response ( ) ,
1152- } ;
1148+ let (
1149+ bid,
1150+ uid,
1151+ guest_name,
1152+ guest_email,
1153+ start_at,
1154+ end_at,
1155+ event_title,
1156+ _account_id,
1157+ guest_timezone,
1158+ ) = match booking {
1159+ Some ( b) => b,
1160+ None => return Redirect :: to ( "/dashboard/bookings" ) . into_response ( ) ,
1161+ } ;
11531162
11541163 // Cancel the booking
11551164 let _ = sqlx:: query ( "UPDATE bookings SET status = 'cancelled' WHERE id = ?" )
@@ -6429,21 +6438,30 @@ async fn decline_booking_by_token(
64296438 . await
64306439 . unwrap_or ( None ) ;
64316440
6432- let ( bid, guest_name, guest_email, start_at, end_at, event_title, host_name, host_email, guest_timezone) =
6433- match booking {
6434- Some ( b) => b,
6435- None => {
6436- let tmpl = state
6437- . templates
6438- . get_template ( "booking_action_error.html" )
6439- . unwrap ( ) ;
6440- let rendered = tmpl. render ( context ! {
6441+ let (
6442+ bid,
6443+ guest_name,
6444+ guest_email,
6445+ start_at,
6446+ end_at,
6447+ event_title,
6448+ host_name,
6449+ host_email,
6450+ guest_timezone,
6451+ ) = match booking {
6452+ Some ( b) => b,
6453+ None => {
6454+ let tmpl = state
6455+ . templates
6456+ . get_template ( "booking_action_error.html" )
6457+ . unwrap ( ) ;
6458+ let rendered = tmpl. render ( context ! {
64416459 title => "Invalid link" ,
64426460 message => "This decline link is invalid, has expired, or the booking has already been processed." ,
64436461 } ) . unwrap_or_else ( |e| format ! ( "Template error: {}" , e) ) ;
6444- return Html ( rendered) . into_response ( ) ;
6445- }
6446- } ;
6462+ return Html ( rendered) . into_response ( ) ;
6463+ }
6464+ } ;
64476465
64486466 // Decline the booking
64496467 let _ = sqlx:: query ( "UPDATE bookings SET status = 'declined' WHERE id = ?" )
@@ -6597,23 +6615,33 @@ async fn guest_cancel_booking(
65976615 . await
65986616 . unwrap_or ( None ) ;
65996617
6600- let ( bid, uid, guest_name, guest_email, start_at, end_at, event_title, host_name, host_email, guest_timezone) =
6601- match booking {
6602- Some ( b) => b,
6603- None => {
6604- let tmpl = state
6605- . templates
6606- . get_template ( "booking_action_error.html" )
6607- . unwrap ( ) ;
6608- let rendered = tmpl
6618+ let (
6619+ bid,
6620+ uid,
6621+ guest_name,
6622+ guest_email,
6623+ start_at,
6624+ end_at,
6625+ event_title,
6626+ host_name,
6627+ host_email,
6628+ guest_timezone,
6629+ ) = match booking {
6630+ Some ( b) => b,
6631+ None => {
6632+ let tmpl = state
6633+ . templates
6634+ . get_template ( "booking_action_error.html" )
6635+ . unwrap ( ) ;
6636+ let rendered = tmpl
66096637 . render ( context ! {
66106638 title => "Invalid link" ,
66116639 message => "This cancellation link is invalid, has expired, or the booking has already been cancelled." ,
66126640 } )
66136641 . unwrap_or_else ( |e| format ! ( "Template error: {}" , e) ) ;
6614- return Html ( rendered) . into_response ( ) ;
6615- }
6616- } ;
6642+ return Html ( rendered) . into_response ( ) ;
6643+ }
6644+ } ;
66176645
66186646 // Cancel the booking
66196647 let _ = sqlx:: query ( "UPDATE bookings SET status = 'cancelled' WHERE id = ?" )
0 commit comments