protected async void OnRemoveFridge() { var wasRemoveSuccessful = await FridgeDataService.DeleteFridge(Fridge.HouseholdId, Fridge.FridgeId); if (wasRemoveSuccessful) { NavigationManager.NavigateTo($"household/{Fridge.HouseholdId}"); ToastService.ShowInfo($"Removed {Fridge.Name}"); } else { ToastService.ShowError($"Failed to remove {Fridge.Name}", "Delete Failed"); } }
protected async Task DeleteFridge(Fridge fridge) { var wasRemoveSuccessfull = await FridgeDataService.DeleteFridge(Household.HouseholdId, fridge.FridgeId); if (wasRemoveSuccessfull) { Fridges.Remove(fridge); StateHasChanged(); ToastService.ShowInfo($"Removed {fridge.Name}"); } else { ToastService.ShowError($"Failed to remove {fridge.Name}", "Delete Failed"); } }