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