fix filter

This commit is contained in:
2025-04-02 20:05:33 +08:00
parent 8054b0235d
commit a6f7172ec4
6 changed files with 106 additions and 61 deletions

View File

@@ -6,11 +6,20 @@ export async function GET(request: NextRequest) {
try {
const searchParams = request.nextUrl.searchParams;
// 获取团队、项目和标签筛选参数
const teamIds = searchParams.getAll('teamId');
const projectIds = searchParams.getAll('projectId');
const tagIds = searchParams.getAll('tagId');
const data = await getGeoAnalytics({
startTime: searchParams.get('startTime') || undefined,
endTime: searchParams.get('endTime') || undefined,
linkId: searchParams.get('linkId') || undefined,
groupBy: (searchParams.get('groupBy') || 'country') as 'country' | 'city'
groupBy: (searchParams.get('groupBy') || 'country') as 'country' | 'city',
// 添加团队、项目和标签筛选
teamIds: teamIds.length > 0 ? teamIds : undefined,
projectIds: projectIds.length > 0 ? projectIds : undefined,
tagIds: tagIds.length > 0 ? tagIds : undefined
});
const response: ApiResponse<typeof data> = {