click subpath

This commit is contained in:
2025-04-10 17:19:40 +08:00
parent ace231b93f
commit 48d5bdafa4
10 changed files with 95 additions and 10 deletions

View File

@@ -18,7 +18,9 @@ export async function GET(request: NextRequest) {
// 添加团队、项目和标签筛选
teamIds: teamIds.length > 0 ? teamIds : undefined,
projectIds: projectIds.length > 0 ? projectIds : undefined,
tagIds: tagIds.length > 0 ? tagIds : undefined
tagIds: tagIds.length > 0 ? tagIds : undefined,
// 添加子路径筛选
subpath: searchParams.get('subpath') || undefined
});
const response: ApiResponse<typeof data> = {

View File

@@ -22,7 +22,9 @@ export async function GET(request: NextRequest) {
// 添加团队、项目和标签筛选
teamIds: teamIds.length > 0 ? teamIds : undefined,
projectIds: projectIds.length > 0 ? projectIds : undefined,
tagIds: tagIds.length > 0 ? tagIds : undefined
tagIds: tagIds.length > 0 ? tagIds : undefined,
// 添加子路径筛选
subpath: searchParams.get('subpath') || undefined
});
const response: ApiResponse<typeof data> = {

View File

@@ -13,7 +13,9 @@ export async function GET(request: NextRequest) {
// Add debug log to check if linkId is being received
const linkId = searchParams.get('linkId');
const subpath = searchParams.get('subpath');
console.log('Summary API received linkId:', linkId);
console.log('Summary API received subpath:', subpath);
console.log('Summary API full parameters:', Object.fromEntries(searchParams.entries()));
console.log('Summary API URL:', request.url);
@@ -23,7 +25,8 @@ export async function GET(request: NextRequest) {
linkId: searchParams.get('linkId') || undefined,
teamIds: teamIds.length > 0 ? teamIds : undefined,
projectIds: projectIds.length > 0 ? projectIds : undefined,
tagIds: tagIds.length > 0 ? tagIds : undefined
tagIds: tagIds.length > 0 ? tagIds : undefined,
subpath: searchParams.get('subpath') || undefined
});
const response: ApiResponse<typeof summary> = {

View File

@@ -28,7 +28,9 @@ export async function GET(request: NextRequest) {
// 添加团队、项目和标签筛选
teamIds: teamIds.length > 0 ? teamIds : undefined,
projectIds: projectIds.length > 0 ? projectIds : undefined,
tagIds: tagIds.length > 0 ? tagIds : undefined
tagIds: tagIds.length > 0 ? tagIds : undefined,
// 添加子路径筛选
subpath: searchParams.get('subpath') || undefined
});
const response: ApiResponse<typeof data> = {

View File

@@ -24,6 +24,7 @@ export async function GET(request: NextRequest) {
const startTime = searchParams.get('startTime');
const endTime = searchParams.get('endTime');
const linkId = searchParams.get('linkId');
const subpath = searchParams.get('subpath');
// 获取团队、项目和标签筛选参数
const teamIds = searchParams.getAll('teamId');
@@ -39,6 +40,7 @@ export async function GET(request: NextRequest) {
startTime,
endTime,
linkId,
subpath,
teamIds,
projectIds,
tagIds,
@@ -63,6 +65,11 @@ export async function GET(request: NextRequest) {
conditions.push(`link_id = '${linkId}'`);
}
// 添加子路径筛选
if (subpath) {
conditions.push(`positionCaseInsensitive(url, '/${subpath}') > 0`);
}
// 添加团队筛选
if (teamIds && teamIds.length > 0) {
// 如果只有一个团队ID