From 8054b0235d491e630036a6453fdb016f8a24015d Mon Sep 17 00:00:00 2001 From: William Tso Date: Wed, 2 Apr 2025 18:05:45 +0800 Subject: [PATCH] events trend filters --- app/api/events/time-series/route.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/api/events/time-series/route.ts b/app/api/events/time-series/route.ts index 0e07dbe..6f0a0c5 100644 --- a/app/api/events/time-series/route.ts +++ b/app/api/events/time-series/route.ts @@ -15,11 +15,20 @@ export async function GET(request: NextRequest) { }, { status: 400 }); } + // 获取团队、项目和标签筛选参数 + const teamIds = searchParams.getAll('teamId'); + const projectIds = searchParams.getAll('projectId'); + const tagIds = searchParams.getAll('tagId'); + const data = await getTimeSeriesData({ startTime, endTime, linkId: searchParams.get('linkId') || undefined, - granularity: (searchParams.get('granularity') || 'day') as 'hour' | 'day' | 'week' | 'month' + granularity: (searchParams.get('granularity') || 'day') as 'hour' | 'day' | 'week' | 'month', + // 添加团队、项目和标签筛选 + teamIds: teamIds.length > 0 ? teamIds : undefined, + projectIds: projectIds.length > 0 ? projectIds : undefined, + tagIds: tagIds.length > 0 ? tagIds : undefined }); const response: ApiResponse = {