From 8f346999fba4b765567700e0520315ca2caeb4c8 Mon Sep 17 00:00:00 2001 From: wonder Date: Fri, 19 Jun 2026 22:59:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=8E=20graph=20API=20=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E5=AF=B9=E8=B1=A1=E4=B8=AD=E6=8F=90=E5=8F=96=20commit?= =?UTF-8?q?s=20=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/pages/generate.html | 3 ++- templates/pages/repo.html | 2 +- templates/pages/review.html | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/pages/generate.html b/templates/pages/generate.html index fface87..8354495 100644 --- a/templates/pages/generate.html +++ b/templates/pages/generate.html @@ -99,7 +99,8 @@ try { const graphResp = await fetch(`/api/repos/${repoId}/graph?max_commits=20`); if (graphResp.ok) { - commits = await graphResp.json(); + const gd = await graphResp.json(); + commits = gd.commits || []; } } catch (e) { console.warn('Failed to load recent commits:', e); diff --git a/templates/pages/repo.html b/templates/pages/repo.html index a178a1f..109f78d 100644 --- a/templates/pages/repo.html +++ b/templates/pages/repo.html @@ -173,7 +173,7 @@ let commits = []; try { const graphResp = await fetch(`/api/repos/${repoId}/graph?max_commits=20`); - if (graphResp.ok) commits = await graphResp.json(); + if (graphResp.ok) { const gd = await graphResp.json(); commits = gd.commits || []; } } catch (e) { /* ignore */ } populateRefSelects(currentRefs, commits); diff --git a/templates/pages/review.html b/templates/pages/review.html index 3f44bd6..c0cea55 100644 --- a/templates/pages/review.html +++ b/templates/pages/review.html @@ -121,7 +121,8 @@ try { const graphResp = await fetch(`/api/repos/${repoId}/graph?max_commits=20`); if (graphResp.ok) { - commits = await graphResp.json(); + const gd = await graphResp.json(); + commits = gd.commits || []; } } catch (e) { console.warn('Failed to load recent commits:', e);