From 0074fd71ff72d4e043b566764796bc9207af94ab Mon Sep 17 00:00:00 2001 From: christopher Date: Fri, 27 Feb 2026 14:26:36 +0800 Subject: [PATCH] fix(web): map API `path` field to `repoPath` in fetchRepoInfo The backend `/api/repo` endpoint returns `path` but `ServerRepoInfo` expects `repoPath`, causing `undefined.split('/')` crash in App.tsx when connecting to a local gitnexus serve instance. Fixes #92 --- gitnexus-web/src/services/server-connection.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gitnexus-web/src/services/server-connection.ts b/gitnexus-web/src/services/server-connection.ts index 7687a1fef..8c262000b 100644 --- a/gitnexus-web/src/services/server-connection.ts +++ b/gitnexus-web/src/services/server-connection.ts @@ -69,7 +69,9 @@ export async function fetchRepoInfo(baseUrl: string, repoName?: string): Promise if (!response.ok) { throw new Error(`Server returned ${response.status}: ${response.statusText}`); } - return response.json(); + const data = await response.json(); + // npm gitnexus@1.3.3 returns "path"; git HEAD returns "repoPath" + return { ...data, repoPath: data.repoPath ?? data.path }; } export async function fetchGraph(