Display list of games (#16)

Co-authored-by: Maxime Adler <madler@sqli.com>
Reviewed-on: #16
This commit was merged in pull request #16.
This commit is contained in:
2025-04-17 00:59:30 +02:00
parent 79a9bb91d7
commit d90811723a
25 changed files with 438 additions and 55 deletions

View File

@@ -33,4 +33,17 @@ public class GameGateway(IHttpClientService httpClientService) : IGameGateway
throw new CategoryNotFoundException(ResourcesKey.ErrorFetchCategories);
}
}
public async Task<IEnumerable<GameDto>> FetchGames(PaggingDto pagging)
{
try
{
var result = await httpClientService.FetchDataAsync<IEnumerable<GameDto>>(Endpoints.Game.Fetch(pagging));
return result ?? throw new InvalidOperationException(ResourcesKey.ErrorFetchGames);
}
catch (Exception)
{
throw new CategoryNotFoundException(ResourcesKey.ErrorFetchGames);
}
}
}