From 56d50d339f3a8bb9d914660757ce22e77c393249 Mon Sep 17 00:00:00 2001 From: Sidhin S Thomas Date: Sun, 4 Aug 2024 15:44:42 +0530 Subject: [PATCH] Fix leaking of history when budget is deleted --- api/services/db_service.cs | 2 ++ 1 file changed, 2 insertions(+) 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)