From 92288a30f5652acd98dc6d6881d8bd8a3a52b307 Mon Sep 17 00:00:00 2001 From: martbost Date: Sat, 14 Nov 2026 07:19:15 -0600 Subject: [PATCH] Admin adoption for a member (Marty 2026-11-14): POST /api/admin/tank/adopt {adopter, who, note} runs the same tank.adopt as the member's button (their eligibility and cap, the adoptee's email and chat), no payments-topic post per pickup. For topping up sponsors who lost people when the contract sponsor won. iap-qa member: ALL PASSED Co-Authored-By: Claude Opus 5.5 --- server.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server.js b/server.js index 87ffd1a..07f229f 100644 --- a/server.js +++ b/server.js @@ -3807,6 +3807,17 @@ const server = http.createServer(async (req, res) => { if (!isAdmin(req)) return json(res, 401, { error: 'auth' }); return json(res, 200, await tank.adminView()); } + // an adoption made for a member (Marty 2026-11-14: sponsors who lost people when the contract sponsor won get a few from the + // tank). The same tank.adopt as the member's own button: their eligibility and cap, the adoptee's email and chat. No payments-topic + // post per pickup (a batch would flood it). + if (p === '/api/admin/tank/adopt' && req.method === 'POST') { + if (!isAdmin(req)) return json(res, 401, { error: 'auth' }); + const b = await readBody(req); + if (!b.adopter || !b.who) return json(res, 400, { error: 'adopter and who' }); + if (fraud.excluded(b.adopter)) return json(res, 403, { error: 'Adoptions are not available on that account.' }); + const r = await tank.adopt(String(b.adopter).toLowerCase(), b.who, b.note); + return json(res, r.error ? 400 : 200, r); + } // -- admin Traffic tab: page views + join-page views + signups + $20 buyers, by referring // domain / first-touch source, by landing page, by angle and by day (Marty, 2026-09-12) // login-ad showings per Central day, dashboard vs games (2026-10-18: a week of combined sign-ins before the cap decision)