fix: fetch up to 10000 commits instead of default 100
The backend defaults to returning only 100 commits. Update frontend to explicitly request up to 10000 commits to show full history for most repositories.
This commit is contained in:
@@ -71,9 +71,14 @@ export interface CommitHistoryResponse {
|
||||
export async function getRepositoryHistory(
|
||||
projectId: string,
|
||||
repoId: string,
|
||||
branch?: string
|
||||
branch?: string,
|
||||
limit?: number
|
||||
): Promise<CommitHistoryResponse> {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user