events trend filters

This commit is contained in:
2025-04-02 18:05:45 +08:00
parent b0dbd088e7
commit 8054b0235d

View File

@@ -15,11 +15,20 @@ export async function GET(request: NextRequest) {
}, { status: 400 }); }, { status: 400 });
} }
// 获取团队、项目和标签筛选参数
const teamIds = searchParams.getAll('teamId');
const projectIds = searchParams.getAll('projectId');
const tagIds = searchParams.getAll('tagId');
const data = await getTimeSeriesData({ const data = await getTimeSeriesData({
startTime, startTime,
endTime, endTime,
linkId: searchParams.get('linkId') || undefined, 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<typeof data> = { const response: ApiResponse<typeof data> = {