Updated settings service to support generic types with JSON serialization/deserialization, adjusted setup wizard checks and modified database schema for proper JSONB storage.

This commit is contained in:
2026-01-29 14:47:56 +01:00
parent bb5737bd0b
commit 743f41cbe8
6 changed files with 331 additions and 28 deletions

View File

@@ -34,12 +34,12 @@ public class SetupController : Controller
[AllowAnonymous]
public async Task<ActionResult> GetSetupAsync()
{
var hasBeenSetup = await SettingsService.GetValueAsync(StateSettingsKey);
var hasBeenSetup = await SettingsService.GetValueAsync<bool>(StateSettingsKey);
if (!string.IsNullOrWhiteSpace(hasBeenSetup) && hasBeenSetup.Equals("true", StringComparison.OrdinalIgnoreCase))
if (hasBeenSetup)
return Problem("This instance is already configured", statusCode: 405);
return Ok();
return NoContent();
}
[HttpPost]
@@ -120,7 +120,7 @@ public class SetupController : Controller
await UsersRepository.UpdateAsync(user);
}
await SettingsService.SetValueAsync(StateSettingsKey, "true");
await SettingsService.SetValueAsync(StateSettingsKey, true);
return NoContent();
}