UI: treat existing concept as ok

This commit is contained in:
Carl Niklas Rydberg 2025-12-22 21:43:04 +01:00
parent feaa7cc830
commit d3f4ad18aa

View file

@ -280,6 +280,7 @@ static const char k_amduatd_ui_html[] =
"\n" "\n"
" async function ensureConcept(name){\n" " async function ensureConcept(name){\n"
" const resp = await fetch('/v1/concepts',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({name})});\n" " const resp = await fetch('/v1/concepts',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({name})});\n"
" if(resp.status === 409) return; // already exists\n"
" if(!resp.ok) throw new Error(await resp.text());\n" " if(!resp.ok) throw new Error(await resp.text());\n"
" }\n" " }\n"
"\n" "\n"