Create game from form (#15)

Co-authored-by: Maxime Adler <madler@sqli.com>
Reviewed-on: #15
This commit was merged in pull request #15.
This commit is contained in:
2025-04-15 23:33:02 +02:00
parent 3d713d5749
commit 79a9bb91d7
36 changed files with 383 additions and 114 deletions

View File

@@ -8,6 +8,18 @@ namespace GameIdeas.BlazorApp.Pages.Games.Gateways;
public class GameGateway(IHttpClientService httpClientService) : IGameGateway
{
public async Task<int> CreateGame(GameDto game)
{
try
{
return await httpClientService.PostAsync<int>(Endpoints.Game.Create, game);
}
catch (Exception)
{
throw new GameCreationException(ResourcesKey.ErrorCreateGame);
}
}
public async Task<CategoriesDto> FetchCategories()
{
try