Featured links: Extend run (book more days) replaces Buy more views; visit packs top up by visits; campaign rows say paid up front and runs through
Hugh and Michael both added credits to a featured run expecting more days. Featured is a flat daily buy, so the credits sat unspent until the run ended and their balance read 0 meanwhile. Now: /api/my/campaigns/:id/extend books extra days after the current run (or from today if it ended) and charges them at once; top-up refuses featured; a visits top-up buys more visits at the pack rate, charged now; rows show paid up front + day count + runs through <date> / run ended; explainer under the campaign table; chatbot canned answer + AI prompt updated; my.js v tag bumped. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -2429,6 +2429,15 @@ const server = http.createServer(async (req, res) => {
|
||||
const r = await ads.topUpCampaign(s.email, memberId, m[1], b.credits);
|
||||
return json(res, r.error ? 400 : 200, r);
|
||||
}
|
||||
m = /^\/api\/my\/campaigns\/(\d+)\/extend$/.exec(p); // featured links: book more days (flat, charged now)
|
||||
if (m && req.method === 'POST') {
|
||||
const s = await auth.fromRequest(req);
|
||||
if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
|
||||
const memberId = await auth.refreshMemberId(s);
|
||||
const b = await readBody(req);
|
||||
const r = await ads.extendFeatured(s.email, memberId, m[1], b.days);
|
||||
return json(res, r.error ? 400 : 200, r);
|
||||
}
|
||||
m = /^\/api\/my\/campaigns\/(\d+)\/(pause|resume)$/.exec(p);
|
||||
if (m && req.method === 'POST') {
|
||||
const s = await auth.fromRequest(req);
|
||||
|
||||
Reference in New Issue
Block a user