Exemplo n.º 1
0
        public async Task <IActionResult> UpdateAppSettings([FromBody] EmbedAppSettingsForPutDto newSettings)
        {
            await RequireSiteAdmin();

            AppSettingsRepository repo = AppSettingsRepository.CreateDefault(_serviceProvider);

            AppSettings current = await repo.GetAppSettings();

            current.EmbedTitle   = newSettings.EmbedTitle;
            current.EmbedContent = newSettings.EmbedContent;

            return(Ok(await repo.UpdateAppSettings(current)));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> UpdateAppSettings([FromBody] SettingsAppSettingsForPutDto newSettings)
        {
            await RequireSiteAdmin();

            AppSettingsRepository repo = AppSettingsRepository.CreateDefault(_serviceProvider);

            AppSettings current = await repo.GetAppSettings();

            current.DefaultLanguage    = newSettings.DefaultLanguage;
            current.AuditLogWebhookURL = newSettings.AuditLogWebhookURL ?? string.Empty;
            current.PublicFileMode     = newSettings.PublicFileMode;

            return(Ok(await repo.UpdateAppSettings(current)));
        }