SF-74: Server — CustomImagesController (GET /api/CustomImages), DI registration, appsettings logo config, App.razor

This commit is contained in:
2026-09-04 01:07:04 +02:00
parent 119ee3ec16
commit 5b7157f422
4 changed files with 79 additions and 3 deletions

View File

@@ -326,12 +326,17 @@ try
// User Preferences (theme, dark mode, grid layouts — stored in TBDD_CACHE)
// Registration handled by Infrastructure DependencyInjection (AddEnvelopeGeneratorInfrastructureServices)
// CustomImages — logo sources and heights, configurable per deployment via appsettings.json
builder.Services.Configure<EnvelopeGenerator.Server.Models.CustomImagesOptions>(
config.GetSection(EnvelopeGenerator.Server.Models.CustomImagesOptions.SectionName));
// Client-side services that MainLayout depends on must also be registered here
// so that Blazor Auto prerender (SSR pass) can resolve them on the server.
// ThemeService.InitializeAsync() uses IJSRuntime but is only called in OnAfterRenderAsync
// (never during prerender), so registering it server-side is safe.
builder.Services.AddScoped<EnvelopeGenerator.Server.Client.Services.UserPreferencesService>();
builder.Services.AddScoped<EnvelopeGenerator.Server.Client.Services.ThemeService>();
builder.Services.AddScoped<EnvelopeGenerator.Server.Client.Services.CustomImagesService>();
// Business Services (Server specific)
builder.Services.AddScoped<DocumentService>();