diff --git a/apps/web/src/api/git_repositories.ts b/apps/web/src/api/git_repositories.ts index 864a30f..5102e69 100644 --- a/apps/web/src/api/git_repositories.ts +++ b/apps/web/src/api/git_repositories.ts @@ -71,9 +71,14 @@ export interface CommitHistoryResponse { export async function getRepositoryHistory( projectId: string, repoId: string, - branch?: string + branch?: string, + limit?: number ): Promise { - const params = branch ? `?branch=${encodeURIComponent(branch)}` : ""; + const searchParams = new URLSearchParams(); + if (branch) searchParams.set("branch", branch); + if (limit) searchParams.set("limit", String(limit)); + const queryString = searchParams.toString(); + const params = queryString ? `?${queryString}` : ""; const response = await apiClient.get(`/projects/${projectId}/repositories/${repoId}/history${params}`); return response.data; } diff --git a/apps/web/src/pages/git-history.tsx b/apps/web/src/pages/git-history.tsx index 503ca22..0e0b769 100644 --- a/apps/web/src/pages/git-history.tsx +++ b/apps/web/src/pages/git-history.tsx @@ -18,7 +18,7 @@ export const GitHistoryPage = () => { if (!projectId || !repoId) return; setStatus("loading"); try { - const data = await getRepositoryHistory(projectId, repoId, selectedBranch || undefined); + const data = await getRepositoryHistory(projectId, repoId, selectedBranch || undefined, 10000); setCommits(data.commits); setBranches(data.branches); if (data.branches.length > 0 && !selectedBranch) {