Skip to content

Commit 58d88fd

Browse files
authored
Merge branch 'main' into main
2 parents e0b5a70 + 86ef9c9 commit 58d88fd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

frontend/src/components/dashboard/DashboardHome.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,15 @@ export function DashboardHome() {
5757
},
5858
body: JSON.stringify({ name, git_url: gitUrl, branch })
5959
})
60+
61+
if (!response.ok) {
62+
const err = await response.json().catch(() => ({}))
63+
throw new Error(err.detail || 'Failed to add repository')
64+
}
65+
6066
const data = await response.json()
67+
if (!data.repo_id) throw new Error('Missing repo_id in response')
68+
6169
await fetch(`${API_URL}/repos/${data.repo_id}/index`, {
6270
method: 'POST',
6371
headers: { 'Authorization': `Bearer ${session?.access_token}` }

0 commit comments

Comments
 (0)