get all accounts endpoint added

This commit is contained in:
2024-11-06 16:29:24 +01:00
Unverified
parent d6fda7dbb8
commit 57fd4ba7a1
9 changed files with 113 additions and 1 deletions

View File

@@ -150,6 +150,19 @@ public class AccountsClientService(IHttpClientService httpClientService, IConfig
.ExecuteAction();
}
public async Task GetAccounts(AccountQueryParameters query, Action<IEnumerable<AccountResponse>>? successAction = null)
{
string url = GetUrl(EndpointsConfiguration.Accounts.GetAccounts);
HttpRequest request = new HttpRequest(HttpMethodType.Get, url)
{
Query = query
};
HttpResponse response = await httpClientService.SendRequestAsync(request);
response.RegisterActionFor2XXSuccess(successAction)
.ExecuteAction();
}
public async Task GetAccount(long id, Action<AccountResponse>? successAction = null, Action? notFoundAction = null)
{
string url = GetUrl(EndpointsConfiguration.Accounts.GetAccount, id);

View File

@@ -18,6 +18,7 @@ public interface IAccountsClientService
Task GetAccountProfileBackground(long id, Action<PhotoResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? notFoundAction = null);
Task PutAccountProfileBackground(AccountProfileBackgroundRequest data, Action<PhotoResponse>? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null);
Task DeleteAccountProfileBackground(Action? successAction = null, Action? unauthorizedAction = null);
Task GetAccounts(AccountQueryParameters query, Action<IEnumerable<AccountResponse>>? successAction = null);
Task GetAccount(long id, Action<AccountResponse>? successAction = null, Action? notFoundAction = null);
Task PutAccountProfileInfo(AccountProfileInfoRequest data, Action? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null);
Task PatchAccountUsername(AccountUsernameRequest data, Action? successAction = null, Action<IDictionary<string, string[]>>? badRequestAction = null, Action? unauthorizedAction = null);