mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-07 02:58:02 +00:00
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
This commit is contained in:
parent
50fc8df2a1
commit
0074fd71ff
1 changed files with 3 additions and 1 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue