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
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:
@@ -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<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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user