feat: add Category, Make, Disney Park to filter panel dropdowns with backend endpoints

This commit is contained in:
2026-05-22 18:19:32 -04:00
parent d98a791c96
commit e0412acbe3
2 changed files with 96 additions and 23 deletions
+20
View File
@@ -837,6 +837,26 @@ def list_users():
return [dict(r) for r in rows]
@app.get("/api/categories")
def list_categories():
conn = get_db()
rows = conn.execute(
"SELECT DISTINCT category FROM assets WHERE category IS NOT NULL AND category != '' ORDER BY category"
).fetchall()
conn.close()
return [r["category"] for r in rows]
@app.get("/api/makes")
def list_makes():
conn = get_db()
rows = conn.execute(
"SELECT DISTINCT make FROM assets WHERE make IS NOT NULL AND make != '' ORDER BY make"
).fetchall()
conn.close()
return [r["make"] for r in rows]
# ─── Task 4: POST /api/assets ──────────────────────────────────────────────