create, read, playercount
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
{
|
||||
Task<CreateGuestTokenResponse?> GetGuestToken();
|
||||
Task<Session?> GetSession(string name);
|
||||
Task<ReadAllSessionsResponse?> GetSessions();
|
||||
Task<ReadSessionsPlayerCountResponse?> GetSessions();
|
||||
Task<Guid?> GetToken();
|
||||
Task GuestLogout();
|
||||
Task PostMove(string sessionName, Move move);
|
||||
|
||||
@@ -63,12 +63,12 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<ReadAllSessionsResponse?> GetSessions()
|
||||
public async Task<ReadSessionsPlayerCountResponse?> GetSessions()
|
||||
{
|
||||
var response = await HttpClient.GetAsync(new Uri("Session", UriKind.Relative));
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
return await response.Content.ReadFromJsonAsync<ReadAllSessionsResponse>(serializerOptions);
|
||||
return await response.Content.ReadFromJsonAsync<ReadSessionsPlayerCountResponse>(serializerOptions);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -90,7 +90,6 @@ namespace Shogi.UI.Pages.Home.Api
|
||||
var response = await HttpClient.PostAsJsonAsync(new Uri("Session", UriKind.Relative), new CreateSessionCommand
|
||||
{
|
||||
Name = name,
|
||||
IsPrivate = isPrivate
|
||||
});
|
||||
return response.StatusCode;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user