Code cleanup

This commit is contained in:
2026-01-28 22:39:29 +01:00
parent fc8d59ae12
commit 0878d0885a
4 changed files with 10 additions and 19 deletions

View File

@@ -3,21 +3,14 @@ using Sandbox.Models.ViewModels;
namespace Sandbox.App.Services.AuthService;
public class AuthService : IAuthService
public class AuthService(HttpClient httpClient, AuthenticationStateProvider authenticationStateProvider)
: IAuthService
{
private readonly HttpClient _http;
//private readonly AuthenticationStateProvider _authenticationStateProvider;
// public AuthService(HttpClient httpClient, AuthenticationStateProvider authenticationStateProvider)
public AuthService(HttpClient httpClient)
{
_http = httpClient;
//_authenticationStateProvider = authenticationStateProvider;
}
private readonly AuthenticationStateProvider _authenticationStateProvider = authenticationStateProvider;
public async Task<ServiceResponse<int>> Register(UserRegister request)
{
var result = await _http.PostAsJsonAsync("api/auth/register", request);
var result = await httpClient.PostAsJsonAsync("api/auth/register", request);
return await result.Content.ReadFromJsonAsync<ServiceResponse<int>>();
}