Example #1
0
        public async Task <IActionResult> GetOEmbedInfo()
        {
            AppSettings appSettings = await AppSettingsRepository.CreateDefault(_serviceProvider).GetAppSettings();

            return(new ContentResult()
            {
                Content = appSettings.GetEmbedData(_config.GetBaseUrl()),
                ContentType = "text/html"
            });
        }
Example #2
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)));
        }
Example #3
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)));
        }
Example #4
0
        public async Task <IActionResult> GetAppSettings([FromRoute] ulong guildId)
        {
            await RequireSiteAdmin();

            return(Ok(await AppSettingsRepository.CreateDefault(_serviceProvider).GetAppSettings()));
        }