content upgrades, contribution contact
This commit is contained in:
@@ -23,7 +23,8 @@ const KnowledgebaseContributionSchema = z.object({
|
||||
uploadedFiles: z.string().transform(str => {
|
||||
try { return JSON.parse(str); } catch { return []; }
|
||||
}).pipe(z.array(z.any()).default([])),
|
||||
reason: z.string().optional().nullable().transform(val => val || undefined)
|
||||
reason: z.string().optional().nullable().transform(val => val || undefined),
|
||||
contact: z.string().optional().nullable().transform(val => val || undefined)
|
||||
});
|
||||
|
||||
interface KnowledgebaseContributionData {
|
||||
@@ -37,6 +38,7 @@ interface KnowledgebaseContributionData {
|
||||
tags: string[];
|
||||
uploadedFiles: any[];
|
||||
reason?: string;
|
||||
contact?: string;
|
||||
}
|
||||
|
||||
const rateLimitStore = new Map<string, { count: number; resetTime: number }>();
|
||||
|
||||
@@ -37,7 +37,8 @@ const ContributionRequestSchema = z.object({
|
||||
}),
|
||||
tool: ContributionToolSchema,
|
||||
metadata: z.object({
|
||||
reason: z.string().transform(val => val.trim() === '' ? undefined : val).optional()
|
||||
reason: z.string().transform(val => val.trim() === '' ? undefined : val).optional(),
|
||||
contact: z.string().transform(val => val.trim() === '' ? undefined : val).optional()
|
||||
}).optional()
|
||||
});
|
||||
|
||||
@@ -168,7 +169,8 @@ export const POST: APIRoute = async ({ request }) => {
|
||||
tool: validatedData.tool,
|
||||
metadata: {
|
||||
submitter: userEmail,
|
||||
reason: validatedData.metadata?.reason
|
||||
reason: validatedData.metadata?.reason,
|
||||
contact: validatedData.metadata?.contact
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user