Cleaned up unnecessary System.Net and System.Net.Http.Json usings across multiple files, including controllers and API client classes, to reduce dependencies and improve code clarity.
21 lines
572 B
C#
21 lines
572 B
C#
using DbFirst.BlazorWebApp.Models;
|
|
|
|
namespace DbFirst.BlazorWebApp.Services;
|
|
|
|
public class DashboardApiClient : IDashboardApiClient
|
|
{
|
|
private readonly HttpClient _httpClient;
|
|
private const string Endpoint = "api/dashboard/dashboards";
|
|
|
|
public DashboardApiClient(HttpClient httpClient)
|
|
{
|
|
_httpClient = httpClient;
|
|
}
|
|
|
|
public async Task<List<DashboardInfoDto>> GetAllAsync(CancellationToken ct = default)
|
|
{
|
|
var result = await _httpClient.GetFromJsonAsync<List<DashboardInfoDto>>(Endpoint, ct);
|
|
return result ?? [];
|
|
}
|
|
}
|