feat: causal lab
This commit is contained in:
@@ -520,11 +520,11 @@ function EventDetail({
|
||||
})
|
||||
const cd = await cr.json()
|
||||
if (!cr.ok) throw new Error(cd.detail || cr.statusText)
|
||||
const newTmplId = cd.template?.id ?? cd.template_id
|
||||
const newTmplId = cd.id ?? cd.template?.id ?? cd.template_id
|
||||
if (newTmplId) {
|
||||
setTemplates(prev => [...prev, cd.template].filter(Boolean))
|
||||
setTemplates(prev => [...prev, { id: newTmplId, name: cd.name, category: cd.category, graph_json: cd.graph_json, instruments: cd.instruments, calibration_json: {} }])
|
||||
setSelTmpl(newTmplId)
|
||||
setRecMsg(`✦ Nouveau template créé : ${cd.template?.name ?? 'template'}`)
|
||||
setRecMsg(`✦ Nouveau template créé : ${cd.name ?? 'template'}`)
|
||||
await instantiate(newTmplId)
|
||||
} else {
|
||||
setRecMsg('Template créé mais ID manquant')
|
||||
|
||||
Reference in New Issue
Block a user