click subpath

This commit is contained in:
2025-04-10 18:07:10 +08:00
parent 48d5bdafa4
commit b8cd3716c4
5 changed files with 68 additions and 10 deletions

View File

@@ -14,6 +14,7 @@ export async function GET(request: NextRequest) {
const linkId = searchParams.get('linkId') || undefined;
const linkSlug = searchParams.get('linkSlug') || undefined;
const userId = searchParams.get('userId') || undefined;
const subpath = searchParams.get('subpath') || undefined;
// 获取可能存在的多个团队、项目和标签ID
const teamIds = searchParams.getAll('teamId');
@@ -26,6 +27,7 @@ export async function GET(request: NextRequest) {
const sortOrder = (searchParams.get('sortOrder') as 'asc' | 'desc') || undefined;
console.log("API接收到的tagIds:", tagIds); // 添加日志便于调试
console.log("API接收到的subpath:", subpath); // 添加日志便于调试
// 获取事件列表
const params: EventsQueryParams = {
@@ -35,6 +37,7 @@ export async function GET(request: NextRequest) {
linkId,
linkSlug,
userId,
subpath,
teamIds: teamIds.length > 0 ? teamIds : undefined,
projectIds: projectIds.length > 0 ? projectIds : undefined,
tagIds: tagIds.length > 0 ? tagIds : undefined,
@@ -44,6 +47,9 @@ export async function GET(request: NextRequest) {
sortOrder
};
// 记录完整的参数用于调试
console.log("完整请求参数:", JSON.stringify(params));
const result = await getEvents(params);
const response: ApiResponse<typeof result.events> = {