diff --git a/Endpoint/Controllers/Configuration/SetupController.cs b/Endpoint/Controllers/Configuration/SetupController.cs index 7abd5ee..ac55b56 100644 --- a/Endpoint/Controllers/Configuration/SetupController.cs +++ b/Endpoint/Controllers/Configuration/SetupController.cs @@ -28,7 +28,9 @@ namespace Mirea.Api.Endpoint.Controllers.Configuration; [MaintenanceModeIgnore] public class SetupController(ISetupToken setupToken, IMaintenanceModeNotConfigureService notConfigureService, IMemoryCache cache) : BaseController { - private const string CacheGeneralKey = "config_part"; + private const string CacheGeneralKey = "config_general"; + private const string CacheAdminKey = "config_admin"; + private GeneralConfig GeneralConfig { get => cache.Get(CacheGeneralKey) ?? new GeneralConfig(); @@ -190,6 +192,16 @@ public class SetupController(ISetupToken setupToken, IMaintenanceModeNotConfigur return Ok(true); } + [HttpPost("CreateAdmin")] + [TokenAuthentication] + [BadRequestResponse] + public ActionResult CreateAdmin([FromBody] CreateUserRequest user) + { + // todo: change CreateUserRequest to Domain entity + cache.Set(CacheAdminKey, user); + return Ok(true); + } + [HttpPost("SetLogging")] [TokenAuthentication] [BadRequestResponse]