diff --git a/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs b/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs index f951770..a49fc20 100644 --- a/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs +++ b/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs @@ -43,7 +43,20 @@ namespace FoodsharingSiegen.Server.Controls { var headerText = $"{type.Translate(AppSettings)} für {Prospect.Name} eintragen"; - await InteractionDialog.ShowAsync(ModalService, new(type, Prospect.Id, headerText, OnDataChanged)); + Func onSuccess = async () => + { + if (type == InteractionType.IdCheck && Prospect.Images != null && Prospect.Images.Count > 0) + { + await ConfirmDialog.ShowAsync(ModalService, "Personalausweisbilder löschen?", $"Möchtest du die Personalausweisbilder von {Prospect.Name} löschen? Diese werden für die weitere Bearbeitung nicht mehr benötigt und enthalten persönliche Daten.", async () => + { + var result = await ProspectService.DeleteVerificationImagesAsync(Prospect.Id); + await OnDataChanged(); + }); + } + await OnDataChanged(); + }; + + await InteractionDialog.ShowAsync(ModalService, new(type, Prospect.Id, headerText, onSuccess)); } } diff --git a/FoodsharingSiegen.Server/Dialogs/InteractionDialog.razor.cs b/FoodsharingSiegen.Server/Dialogs/InteractionDialog.razor.cs index e5ce1ce..621876e 100644 --- a/FoodsharingSiegen.Server/Dialogs/InteractionDialog.razor.cs +++ b/FoodsharingSiegen.Server/Dialogs/InteractionDialog.razor.cs @@ -127,9 +127,10 @@ namespace FoodsharingSiegen.Server.Dialogs Interaction.UserID = CurrentUser.Id; var addR = await ProspectService.AddInteraction(Interaction); - if (addR.Success && OnSuccess != null) await OnSuccess.Invoke(); await ModalService.Hide(); + + if (addR.Success && OnSuccess != null) await OnSuccess.Invoke(); } #endregion