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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user