Admin credit grant: purchased:true grants at purchase grade, like InstantAdPay's (Marty 2026-11-20)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2411,8 +2411,10 @@ const server = http.createServer(async (req, res) => {
|
|||||||
if (b.grantCredits !== undefined) {
|
if (b.grantCredits !== undefined) {
|
||||||
const n = Math.round(Number(b.grantCredits));
|
const n = Math.round(Number(b.grantCredits));
|
||||||
if (!(n > 0) || n > 100000) return json(res, 400, { error: 'Credits: a whole number from 1 to 100,000.' });
|
if (!(n > 0) || n > 100000) return json(res, 400, { error: 'Credits: a whole number from 1 to 100,000.' });
|
||||||
await ads.addEarned(e, n);
|
// purchased: true grants at purchase grade, so the credits also cover purchased-only spends (same switch as
|
||||||
console.log('admin credits', e, n, String(b.note || '').slice(0, 100));
|
// InstantAdPay's grant; Marty 2026-11-20, Orlando's 25,000 bonus); without it the grant is ordinary earned credits
|
||||||
|
await ads.addEarned(e, n, b.purchased === true ? { purchased: true } : undefined);
|
||||||
|
console.log('admin credits', e, n, b.purchased === true ? '(purchase grade)' : '', String(b.note || '').slice(0, 100));
|
||||||
}
|
}
|
||||||
return json(res, 200, await adminMember.view(e));
|
return json(res, 200, await adminMember.view(e));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user