fix(cowork-service): audit proxy missing taskId and tool query param forwarding
AuditQuerySchema now accepts taskId and tool optional fields. Route forwards them as query params to platform-service GET /audit. Previously these filters sent by the frontend were silently stripped.
This commit is contained in:
parent
8e12409938
commit
a9d4c63e03
@ -22,10 +22,12 @@ export async function auditRoutes(app: FastifyInstance) {
|
||||
return { error: 'Invalid query', details: parsed.error.issues };
|
||||
}
|
||||
|
||||
const { action, category, days, limit, offset } = parsed.data;
|
||||
const { action, category, taskId, tool, days, limit, offset } = parsed.data;
|
||||
const params = new URLSearchParams();
|
||||
if (action) params.set('action', action);
|
||||
if (category) params.set('category', category);
|
||||
if (taskId) params.set('taskId', taskId);
|
||||
if (tool) params.set('tool', tool);
|
||||
params.set('days', String(days));
|
||||
params.set('limit', String(limit));
|
||||
params.set('offset', String(offset));
|
||||
|
||||
@ -9,6 +9,8 @@ import { z } from 'zod';
|
||||
export const AuditQuerySchema = z.object({
|
||||
action: z.string().optional(),
|
||||
category: z.string().optional(),
|
||||
taskId: z.string().optional(),
|
||||
tool: z.string().optional(),
|
||||
days: z.coerce.number().int().min(1).max(365).default(30),
|
||||
limit: z.coerce.number().int().min(1).max(1000).default(100),
|
||||
offset: z.coerce.number().int().min(0).default(0),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user