Builder: admin can hide a program (/api/admin/programs, /api/admin/program-hide); Xpress Viral Mailer hidden in the seed, its site is suspended (Michael's report, Marty 2026-11-22)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-22 05:45:04 -06:00
parent 268d106407
commit d8c01bfb66
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -587,7 +587,7 @@
"cat": "0",
"order": 34,
"ctbMemberLinks": 52,
"hidden": false,
"hidden": true,
"network": false,
"note": "",
"defaultId": "",
+6
View File
@@ -447,6 +447,12 @@ const server = http.createServer(async (req, res) => {
// -- admin (x-admin-token: ADMIN_TOKEN)
if (p.startsWith('/api/admin/')) {
if (!isAdmin(req)) return json(res, 401, { error: 'no' });
// the builder list, and hide/show one program: { id, hidden } (a closed program leaves the builder; saved IDs stay) (Marty 2026-11-22: Xpress Viral Mailer out)
if (p === '/api/admin/programs' && req.method === 'GET') return json(res, 200, { programs: programs().map(x => ({ id: x.id, name: x.name, url: x.url, hidden: !!x.hidden, order: x.order })) });
if (p === '/api/admin/program-hide' && req.method === 'POST') {
const b = await readBody(req); const pr = programs().find(x => x.id === String(b.id || '')); if (!pr) return json(res, 404, { error: 'not found' });
pr.hidden = !!b.hidden; store.save(); return json(res, 200, { ok: true, program: { id: pr.id, name: pr.name, hidden: pr.hidden } });
}
if (p === '/api/admin/status' && req.method === 'GET') {
const t = now(); const w = league.weekInfo(t); const d = store.draft(w.week);
return json(res, 200, { day: store.ctDay(t), week: w.week, now: t, draftAt: w.draftAt, config: { position: Object.assign({}, C.position, { picksOnBuy: weekend.picks(C), weekend: weekend.live() }), split: C.split, draft: C.draft, picks: C.picks, pot: C.pot, tankMode: C.tankMode },