Reload data on submit
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 39s

This commit is contained in:
Maxime Adler
2025-04-15 12:18:31 +02:00
parent ad05e210c2
commit 01ada94adb
3 changed files with 8 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ public partial class GameCreationForm
[Inject] private IGameGateway GameGateway { get; set; } = default!;
[CascadingParameter] private Popup? Popup { get; set; }
[Parameter] public CategoriesDto? Categories { get; set; }
[Parameter] public EventCallback OnSubmit { get; set; }
private GameDto GameDto = new();
private EditContext? EditContext;
@@ -57,6 +58,7 @@ public partial class GameCreationForm
if (gameId != 0)
{
Popup?.Close();
await OnSubmit.InvokeAsync();
}
}
catch (Exception)

View File

@@ -25,5 +25,5 @@
</div>
<Popup @ref=ManualAddPopup BackdropFilterClicked="HandleBackdropManualAddClicked" Closable=false>
<GameCreationForm Categories="Categories" />
<GameCreationForm Categories="Categories" OnSubmit="HandleFetchCategories" />
</Popup>

View File

@@ -17,7 +17,7 @@ public partial class GameBase ()
protected override async Task OnInitializedAsync()
{
Categories = await GameGateway.FetchCategories();
await HandleFetchCategories();
await base.OnInitializedAsync();
}
private void HandleAddClicked(AddType addType)
@@ -37,4 +37,8 @@ public partial class GameBase ()
{
ManualAddPopup?.Close();
}
private async Task HandleFetchCategories()
{
Categories = await GameGateway.FetchCategories();
}
}