DEV: Move config area site setting fetch into new controller (#28136)

Followup 4aea12fdcb

In certain config areas (like About) we want to be able
to fetch specific site settings by name. In this case,
sometimes we need to be able to fetch hidden settings,
in cases where a config area is still experimental.

Splitting out a different endpoint for this purpose
allows us to be stricter with what we return for config
areas without affecting the main site settings UI, revealing
hidden settings before they are ready.
This commit is contained in:
Martin Brennan
2024-07-30 15:41:28 +10:00
committed by GitHub
parent 284aa1da22
commit 2d5f323ca3
6 changed files with 103 additions and 29 deletions

View File

@@ -387,6 +387,8 @@ Discourse::Application.routes.draw do
end
end
namespace :config, constraints: StaffConstraint.new do
resources :site_settings, only: %i[index]
resources :flags, only: %i[index new create update destroy] do
put "toggle"
put "reorder/:direction" => "flags#reorder"