From 6bc2757eb0abb4a521de059248ad9c86ef7bcc2e Mon Sep 17 00:00:00 2001 From: Andre Beging Date: Thu, 27 Mar 2025 17:47:53 +0100 Subject: [PATCH] Autoselect interaction creator --- .../Controls/ProspectContainer.razor.cs | 2 +- .../Dialogs/AddInteractionModal.razor | 24 +++++++++---------- .../Dialogs/AddInteractionModal.razor.cs | 2 +- .../Pages/Prospects.razor.cs | 1 + .../Pages/ProspectsTodo.razor.cs | 1 + 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs b/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs index 93f4983..eb12fce 100644 --- a/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs +++ b/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs @@ -21,7 +21,7 @@ namespace FoodsharingSiegen.Server.Controls private async Task AddInteraction(InteractionType type) { - await InteractionModal.Show(type, Prospect?.Id); + await InteractionModal.ShowAsync(type, Prospect?.Id); } private List GetTyped(InteractionType type) diff --git a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor index 9258e6c..fe92848 100644 --- a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor +++ b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor @@ -24,21 +24,21 @@ }
-
- - Wer? - - -
+ @*
*@ + @* *@ + @* Wer? *@ + @* *@ + @* *@ + @*
*@
Wann? - +
diff --git a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs index 3d1a4c3..79e53d9 100644 --- a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs +++ b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs @@ -31,7 +31,7 @@ namespace FoodsharingSiegen.Server.Dialogs await base.OnParametersSetAsync(); } - public async Task Show(InteractionType type, Guid? prospectId) + public async Task ShowAsync(InteractionType type, Guid? prospectId) { if (prospectId == null) return; _showInfo = false; diff --git a/FoodsharingSiegen.Server/Pages/Prospects.razor.cs b/FoodsharingSiegen.Server/Pages/Prospects.razor.cs index 3fc0238..8cc3580 100644 --- a/FoodsharingSiegen.Server/Pages/Prospects.razor.cs +++ b/FoodsharingSiegen.Server/Pages/Prospects.razor.cs @@ -112,6 +112,7 @@ namespace FoodsharingSiegen.Server.Pages /// The arg private async Task OnAddInteraction(Interaction arg) { + arg.UserID = CurrentUser.Id; await ProspectService.AddInteraction(arg); await LoadProspects(); } diff --git a/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor.cs b/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor.cs index 28107dd..366a245 100644 --- a/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor.cs +++ b/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor.cs @@ -110,6 +110,7 @@ namespace FoodsharingSiegen.Server.Pages /// The arg private async Task OnAddInteraction(Interaction arg) { + arg.UserID = CurrentUser.Id; await ProspectService.AddInteraction(arg); await LoadProspects(); }