feat: causal lab
This commit is contained in:
@@ -407,7 +407,14 @@ function EventDetail({
|
||||
|
||||
const loadAnalyses = useCallback(async () => {
|
||||
const r = await fetch(`/api/causal-lab/analyses?market_event_id=${event.id}&limit=20`)
|
||||
if (r.ok) setAnalyses(await r.json())
|
||||
if (r.ok) {
|
||||
const data: CausalAnalysis[] = await r.json()
|
||||
setAnalyses(data)
|
||||
// Pre-select the most recent analysis's template so the form isn't blank on re-open
|
||||
if (data.length > 0 && data[0].template_id) {
|
||||
setSelTmpl(data[0].template_id)
|
||||
}
|
||||
}
|
||||
}, [event.id])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user