Add edit functionality for EinAb interactions: implement UpdateInteraction method, extend InteractionDialog for edit mode, and add edit button in InteractionRow

This commit is contained in:
troogs
2026-09-14 16:09:13 +02:00
parent fdd7ea5a40
commit 8b298b37c7
11 changed files with 360 additions and 24 deletions
@@ -62,6 +62,24 @@ namespace FoodsharingSiegen.Server.Controls
#endregion
#region Private Method EditInteraction
private async Task EditInteraction(Guid interactionId)
{
if (Prospect == null || OnDataChanged == null) return;
var interaction = Prospect.Interactions.FirstOrDefault(x => x.Id == interactionId);
if (interaction == null || !InteractionDialog.IsEditable(interaction.Type)) return;
var headerText = $"{interaction.Type.Translate(AppSettings)} für {Prospect.Name} bearbeiten";
Func<Task> onSuccess = async () => await OnDataChanged();
await InteractionDialog.ShowAsync(ModalService, new(interaction.Type, Prospect.Id, headerText, onSuccess, interaction));
}
#endregion
#region Private Method DeleteProspectAsync
/// <summary>