diff --git a/src/routes/internal/billing.rs b/src/routes/internal/billing.rs index 24f131a4..15b9ec0f 100644 --- a/src/routes/internal/billing.rs +++ b/src/routes/internal/billing.rs @@ -160,7 +160,7 @@ pub async fn edit_subscription( if let Some(cancelled) = &edit_subscription.cancelled { if open_charge.status != ChargeStatus::Open - || open_charge.status != ChargeStatus::Cancelled + && open_charge.status != ChargeStatus::Cancelled { return Err(ApiError::InvalidInput( "You may not change the status of this subscription!".to_string(), @@ -190,6 +190,8 @@ pub async fn edit_subscription( }; } + open_charge.upsert(&mut transaction).await?; + transaction.commit().await?; Ok(HttpResponse::NoContent().body(""))