Spaces:
Running
Running
Commit ·
daf86d8
1
Parent(s): 1b77cde
fix(phase-33): fix _renderTimeline to call /timeline/ not /biography/
Browse filesWas calling /biography/{entityId}. BiographyResponse wraps events in
nested { timeline: { events: [] } } -- narrative format, not structured.
New /timeline/{entityId} returns flat structured events:
{ events: [{date, category, title, detail, amount_crore, source}] }
Also fixed events extraction and sort order to newest-first.
frontend/js/evidence_panel.js
CHANGED
|
@@ -264,10 +264,11 @@ const EvidencePanel = {
|
|
| 264 |
if (!el) return;
|
| 265 |
el.innerHTML = `<div class="spinner" style="margin:60px auto"></div>`;
|
| 266 |
try {
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
const
|
| 270 |
-
|
|
|
|
| 271 |
if (!events.length) {
|
| 272 |
el.innerHTML = `<div style="text-align:center;padding:40px;color:var(--text-muted);font-size:12px">
|
| 273 |
No timeline events indexed for this entity</div>`;
|
|
|
|
| 264 |
if (!el) return;
|
| 265 |
el.innerHTML = `<div class="spinner" style="margin:60px auto"></div>`;
|
| 266 |
try {
|
| 267 |
+
// Phase 33 FIX: /biography returns narrative events, not structured ones.
|
| 268 |
+
// /timeline returns all time-stamped node activity.
|
| 269 |
+
const data = await Api._request(`/timeline/${entityId}`);
|
| 270 |
+
const events = ((data && data.events) ? data.events : [])
|
| 271 |
+
.sort((a,b) => (b.date||"").localeCompare(a.date||""));
|
| 272 |
if (!events.length) {
|
| 273 |
el.innerHTML = `<div style="text-align:center;padding:40px;color:var(--text-muted);font-size:12px">
|
| 274 |
No timeline events indexed for this entity</div>`;
|