Enhance interaction handling: add confirmation dialog for deleting verification images and ensure OnSuccess callback is invoked after adding interactions
All checks were successful
Build And Push Dev Docker Image / docker (push) Successful in 1m42s

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
a.beging@eas-solutions.de
2026-04-29 16:17:11 +02:00
parent 6807f2b6e6
commit f4f04e4a42
2 changed files with 16 additions and 2 deletions

View File

@@ -43,7 +43,20 @@ namespace FoodsharingSiegen.Server.Controls
{ {
var headerText = $"{type.Translate(AppSettings)} für {Prospect.Name} eintragen"; var headerText = $"{type.Translate(AppSettings)} für {Prospect.Name} eintragen";
await InteractionDialog.ShowAsync(ModalService, new(type, Prospect.Id, headerText, OnDataChanged)); Func<Task> 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));
} }
} }

View File

@@ -127,9 +127,10 @@ namespace FoodsharingSiegen.Server.Dialogs
Interaction.UserID = CurrentUser.Id; Interaction.UserID = CurrentUser.Id;
var addR = await ProspectService.AddInteraction(Interaction); var addR = await ProspectService.AddInteraction(Interaction);
if (addR.Success && OnSuccess != null) await OnSuccess.Invoke();
await ModalService.Hide(); await ModalService.Hide();
if (addR.Success && OnSuccess != null) await OnSuccess.Invoke();
} }
#endregion #endregion