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

@@ -24,6 +24,7 @@ namespace LaDOSE.REST
public event EventHandler<UpdatedJwtEventHandler> UpdatedJwtEvent;
public RestService()
{
@@ -33,7 +34,15 @@ namespace LaDOSE.REST
public void Connect(Uri url, string user, string password)
{
Client = new RestClient(url);
string token = GetToken(user, password);
string token;
try
{
token = GetToken(user, password);
}
catch (Exception)
{
return;
}
Client = new RestClient(url, options =>
{
#if DEBUG
@@ -204,6 +213,14 @@ namespace LaDOSE.REST
var restResponse = Client.Get<List<GameDTO>>(restRequest);
return restResponse;
}
public List<GameDTO> GetSmashGames(string name)
{
CheckToken();
var restRequest = new RestRequest($"/api/Game/Smash/{name}", Method.Get);
var restResponse = Client.Get<List<GameDTO>>(restRequest);
return restResponse;
}
public GameDTO UpdateGame(GameDTO game)
{