Refactor to use IHttpClientFactory and remove ApiOptions

Replaced direct injection of HttpClient with IHttpClientFactory
across the codebase to improve HTTP client management and align
with best practices. Removed dependency on ApiOptions and
IOptions<ApiOptions> in multiple services, simplifying constructors
and reducing configuration complexity.

Updated FontLoader to use IHttpClientFactory for font loading
with relative paths. Adjusted comments and documentation to
reflect these changes. Cleaned up unused using directives
related to ApiOptions.
This commit is contained in:
2026-06-24 10:01:19 +02:00
parent 0fdaa1a38d
commit c6c1decd2a
8 changed files with 20 additions and 33 deletions

View File

@@ -1,7 +1,5 @@
using System.Net.Http;
using System.Net.Http.Json;
using Microsoft.Extensions.Options;
using EnvelopeGenerator.Server.Client.Options;
using EnvelopeGenerator.Server.Client.Models;
namespace EnvelopeGenerator.Server.Client.Services;
@@ -9,9 +7,8 @@ namespace EnvelopeGenerator.Server.Client.Services;
/// <summary>
/// Client service for managing cached signatures via API.
/// </summary>
public class SignatureCacheService(IHttpClientFactory httpClientFactory, IOptions<ApiOptions> apiOptions)
public class SignatureCacheService(IHttpClientFactory httpClientFactory)
{
private readonly ApiOptions _api = apiOptions.Value;
public async Task SaveSignatureAsync(
string envelopeKey,