push my ork

This commit is contained in:
2024-08-15 09:20:31 +02:00
parent b08c7619a4
commit 24708eb798

View File

@@ -14,14 +14,16 @@ public class OwnCharApiClient
internal string? AuthSecret { get; set; } = null;
public bool IsLoggedIn => AuthSecret != null;
public string ApiUrl { get; }
public LoginApiClient Auth { get; }
public UsersApiClient Users { get; }
public CharactersApiClient Characters { get; }
public GroupsApiClient Groups { get; }
public OwnCharApiClient()
public OwnCharApiClient(string apiUrl)
{
this.ApiUrl = apiUrl;
Auth = GetClient<LoginApiClient>();
Users = GetClient<UsersApiClient>();
Characters = GetClient<CharactersApiClient>();
@@ -55,8 +57,9 @@ public class OwnCharApiClient
{
request.AuthSecret = AuthSecret;
var content = new StringContent(JsonHelpers.SerializeRequest(request)!, MediaTypeHeaderValue.Parse("application/json"));
var res = await httpClient.PostAsync(requestUrl, content);
var fullRequestUrl = ApiUrl + requestUrl;
var content = new StringContent(JsonHelpers.SerializeRequest(request)!, null, "application/json");
var res = await httpClient.PostAsync(fullRequestUrl, content);
if (res.IsSuccessStatusCode)
return JsonHelpers.DeserializeResponse<TResponse>(await res.Content.ReadAsStringAsync());