diff --git a/api/services/db_service.cs b/api/services/db_service.cs index f3e66a6..d7d643f 100644 --- a/api/services/db_service.cs +++ b/api/services/db_service.cs @@ -163,9 +163,11 @@ public async Task AddRecurringAsync(string budget_id, Recurring recurring) public async Task DeleteBudgetAsync(string budget_id) { var user_data = await GetUserData(_identityService.GetUserIdentity()); + var budget = await GetBudgetAsync(budget_id); user_data.BudgetIds.Remove(budget_id); await UpdateUserData(user_data); await _container.DeleteItemAsync(budget_id, new PartitionKey(budget_id)); + await _container.DeleteItemAsync(budget.history_id, new PartitionKey(budget.history_id)); } public async Task DeleteCategoryAsync(string budget_id, int category_id)