Reload data on submit
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 39s
All checks were successful
Game Ideas build for PR / build_blazor_app (pull_request) Successful in 39s
This commit is contained in:
@@ -16,6 +16,7 @@ public partial class GameCreationForm
|
|||||||
[Inject] private IGameGateway GameGateway { get; set; } = default!;
|
[Inject] private IGameGateway GameGateway { get; set; } = default!;
|
||||||
[CascadingParameter] private Popup? Popup { get; set; }
|
[CascadingParameter] private Popup? Popup { get; set; }
|
||||||
[Parameter] public CategoriesDto? Categories { get; set; }
|
[Parameter] public CategoriesDto? Categories { get; set; }
|
||||||
|
[Parameter] public EventCallback OnSubmit { get; set; }
|
||||||
|
|
||||||
private GameDto GameDto = new();
|
private GameDto GameDto = new();
|
||||||
private EditContext? EditContext;
|
private EditContext? EditContext;
|
||||||
@@ -57,6 +58,7 @@ public partial class GameCreationForm
|
|||||||
if (gameId != 0)
|
if (gameId != 0)
|
||||||
{
|
{
|
||||||
Popup?.Close();
|
Popup?.Close();
|
||||||
|
await OnSubmit.InvokeAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|||||||
@@ -25,5 +25,5 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Popup @ref=ManualAddPopup BackdropFilterClicked="HandleBackdropManualAddClicked" Closable=false>
|
<Popup @ref=ManualAddPopup BackdropFilterClicked="HandleBackdropManualAddClicked" Closable=false>
|
||||||
<GameCreationForm Categories="Categories" />
|
<GameCreationForm Categories="Categories" OnSubmit="HandleFetchCategories" />
|
||||||
</Popup>
|
</Popup>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public partial class GameBase ()
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
Categories = await GameGateway.FetchCategories();
|
await HandleFetchCategories();
|
||||||
await base.OnInitializedAsync();
|
await base.OnInitializedAsync();
|
||||||
}
|
}
|
||||||
private void HandleAddClicked(AddType addType)
|
private void HandleAddClicked(AddType addType)
|
||||||
@@ -37,4 +37,8 @@ public partial class GameBase ()
|
|||||||
{
|
{
|
||||||
ManualAddPopup?.Close();
|
ManualAddPopup?.Close();
|
||||||
}
|
}
|
||||||
|
private async Task HandleFetchCategories()
|
||||||
|
{
|
||||||
|
Categories = await GameGateway.FetchCategories();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user