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