mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-28 09:23:08 +08:00
feat: 更新分析会话 API,支持分页和并发处理
This commit is contained in:
@@ -7141,11 +7141,19 @@ import type { AnalysisSessionSummary, AnalysisSessionDetail } from '../types/ana
|
||||
* Fetch list of analysis sessions
|
||||
*/
|
||||
export async function fetchAnalysisSessions(
|
||||
projectPath?: string
|
||||
projectPath?: string,
|
||||
options?: { limit?: number; offset?: number }
|
||||
): Promise<AnalysisSessionSummary[]> {
|
||||
const data = await fetchApi<{ success: boolean; data: AnalysisSessionSummary[]; error?: string }>(
|
||||
withPath('/api/analysis', projectPath)
|
||||
);
|
||||
const params = new URLSearchParams();
|
||||
if (options?.limit) params.set('limit', String(options.limit));
|
||||
if (options?.offset) params.set('offset', String(options.offset));
|
||||
|
||||
const queryString = params.toString();
|
||||
const path = queryString
|
||||
? `${withPath('/api/analysis', projectPath)}&${queryString}`
|
||||
: withPath('/api/analysis', projectPath);
|
||||
|
||||
const data = await fetchApi<{ success: boolean; data: AnalysisSessionSummary[]; error?: string }>(path);
|
||||
if (!data.success) {
|
||||
throw new Error(data.error || 'Failed to fetch analysis sessions');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user