Move edit prospect dialog logic

This commit is contained in:
Andre Beging
2025-03-28 18:49:38 +01:00
parent 97deed7d90
commit d754da76cd
15 changed files with 173 additions and 170 deletions

View File

@@ -10,8 +10,6 @@ namespace FoodsharingSiegen.Server.Controls
[Parameter] public AddInteractionModal InteractionModal { get; set; } = null!;
[Parameter] public AddProspectModal? ProspectModal { get; set; } = null!;
[Parameter] public Func<Guid, Task>? RemoveInteraction { get; set; }
[Parameter] public ProspectStateFilter StateFilter { get; set; }
@@ -26,7 +24,12 @@ namespace FoodsharingSiegen.Server.Controls
private List<Interaction> GetTyped(InteractionType type)
{
return Prospect?.Interactions?.Where(x => x.Type == type).ToList() ?? new List<Interaction>();
return Prospect?.Interactions?.Where(x => x.Type == type).ToList() ?? [];
}
private async Task EditProspectAsync()
{
await EditProspectDialog.ShowAsync(ModalService, () => InvokeAsync(StateHasChanged), Prospect);
}
}
}