diff --git a/src/routes/household.rs b/src/routes/household.rs index 4ea4a7b..03b7a13 100644 --- a/src/routes/household.rs +++ b/src/routes/household.rs @@ -136,6 +136,10 @@ async fn delete_household( household: household::Model, txn: &DatabaseTransaction, ) -> Result<(), RouteError> { + for ingredient in household.find_related(Ingredient).all(txn).await? { + ingredient.delete(txn).await?; + } + household.delete(txn).await?; Ok(())