fix(admin): remove manual reasons and repair code creation
Independent Staging Quality Gate / validate (push) Has been cancelled
Independent Staging Quality Gate / publish (push) Has been cancelled

This commit is contained in:
Jesse_Chen
2026-08-16 16:49:11 +08:00
parent 9df43e8112
commit c712787ec2
24 changed files with 180 additions and 206 deletions
+1 -2
View File
@@ -28,7 +28,6 @@ const createCodesSchema = z.object({
count: z.number().int().min(1).max(100),
expiresAt: z.string().datetime({ offset: true }).nullable().optional(),
note: z.string().trim().max(500).nullable().optional(),
reason: z.string().trim().min(1).max(500),
});
type CodeRow = {
@@ -147,7 +146,7 @@ export async function POST(request: Request) {
"admin_create_redemption_codes",
session,
operationRequestId,
{ p_codes: records, p_reason: parsed.data.reason },
{ p_codes: records, p_reason: "admin_console_create_redemption_codes" },
);
const byMask = new Map<string, RedemptionCodeRecord>(
stored.map((record) => [record.mask, record]),