feat(dashboard_api): GET /webhook/inc-filter-options (explorer pulldowns)
Some checks failed
Static Analysis / static (push) Has been cancelled
Tests / test (push) Has been cancelled
Static Analysis / static (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled

Passthrough over reporting.fn_inc_filter_options (fleettickets migration 14):
engineers, clusters, open ticket ids for the ticket-explorer dropdowns.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
david kiania 2026-06-19 12:34:46 +03:00
parent e27933b1cb
commit 048d1a3173

View file

@ -425,6 +425,20 @@ def inc_search(
)
@app.get("/webhook/inc-filter-options")
def inc_filter_options():
# Dropdown options for the ticket explorer (engineers, clusters, open ticket ids).
try:
with get_conn() as conn:
with conn.cursor() as cur:
cur.execute("SELECT reporting.fn_inc_filter_options()")
payload = cur.fetchone()[0] or {}
return JSONResponse(payload)
except Exception:
log.exception("inc-filter-options failed")
return JSONResponse({"owners": [], "clusters": [], "open_ticket_ids": []})
# ── Fleet trips (#002) ───────────────────────────────────────────────────────
_FILTER_OPTIONS_SQL = """