Code cleanup
This commit is contained in:
@@ -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>>();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user