Minor fixes to thingie.

This commit is contained in:
Yaro Kasear 2025-08-13 11:58:23 -05:00
parent dfc37bf8b8
commit 462b86c583
4 changed files with 15 additions and 11 deletions

View file

@ -53,6 +53,7 @@ def list_items(model_name):
items = [call(Model, 'ui_serialize', r, view=view) or default_serialize(Model, r, view=view)
for r in rows]
if view=="option":
return render_template('fragments/_option_fragment.html', options=items)
want_html = (request.args.get("view") == "option") or ("HX-Request" in request.headers)
if want_html:
return render_template("fragments/_option_fragment.html", options=items)
return jsonify({"items": items})