From c5f117e5b18bc6369e49d8fb3bd90549e9e3d2ca Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Sun, 24 May 2026 09:20:31 +0000 Subject: [PATCH] feat: add branch listing API function --- apps/web/src/api/git_repositories.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/apps/web/src/api/git_repositories.ts b/apps/web/src/api/git_repositories.ts index 1b07c3e..7eb99dc 100644 --- a/apps/web/src/api/git_repositories.ts +++ b/apps/web/src/api/git_repositories.ts @@ -64,6 +64,27 @@ export async function updateRepositorySshKey( return response.data; } +export interface Branch { + name: string; + is_default: boolean; + last_commit: string | null; +} + +export interface BranchesResponse { + branches: Branch[]; + default_branch: string; +} + +export async function listRepositoryBranches( + projectId: string, + repoId: string +): Promise { + const response = await apiClient.get( + `/projects/${projectId}/repositories/${repoId}/branches` + ); + return response.data; +} + export interface CommitHistoryEntry { hash: string; short_hash: string;