treewide: make less webhook-centric
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ifab58fcb523549ca9cb83dc8467be51e6a6a6964
This commit is contained in:
parent
d8c09eeefa
commit
374408834b
9 changed files with 479 additions and 39 deletions
|
|
@ -9,8 +9,7 @@ export function createDashboardRouter(config: Config): express.Router {
|
|||
|
||||
router.use(express.json());
|
||||
|
||||
// --- API routes ---
|
||||
|
||||
// API routes
|
||||
router.get('/api/status', (_req, res) => {
|
||||
const enabledBackends = Object.entries(config.engine.backends)
|
||||
.filter(([, v]) => v.enabled)
|
||||
|
|
@ -41,7 +40,10 @@ export function createDashboardRouter(config: Config): express.Router {
|
|||
router.put('/api/config', (req, res) => {
|
||||
try {
|
||||
const partial = req.body as Partial<Config>;
|
||||
const merged = deepMerge(config as Record<string, unknown>, partial as Record<string, unknown>) as Config;
|
||||
const merged = deepMerge(
|
||||
config as Record<string, unknown>,
|
||||
partial as Record<string, unknown>
|
||||
) as Config;
|
||||
validate(merged);
|
||||
|
||||
// Apply in-place
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue