Modification get smash
All checks were successful
Build App / Build (push) Successful in 1m53s

This commit is contained in:
2024-03-22 23:58:43 +01:00
parent 88fb4935b5
commit 454c12a5a9
19 changed files with 176 additions and 63 deletions

View File

@@ -47,6 +47,37 @@ namespace LaDOSE.Business.Provider.SmashProvider
return graphQLResponse.Data;
}
public async Task<List<Game>> GetGames(string game)
{
var query = new GraphQLRequest()
{
Query = @"
query VideogameQuery($name:String) {
videogames(query: { filter: { name: $name }, perPage: 5 }) {
nodes {
id
name
displayName
}
}
}
",
OperationName = "VideogameQuery",
Variables = new
{
name = game,
}
};
VideoGamesResponse querySmash = await QuerySmash<VideoGamesResponse>(query);
if (querySmash.videogames != null)
{
return querySmash.videogames.nodes.Select(e => new Game() { Id = e.id, Name = e.Name }).ToList();
}
return new List<Game>();
}
public async Task<Event> GetEvent(string slug)
{

View File

@@ -120,7 +120,10 @@ namespace LaDOSE.Business.Provider.SmashProvider
}
public class VideoGamesResponse
{
public Node<VideoGameType>? videogames {get; set; }
}
public class TournamentResponse