feat: add Category, Make, Disney Park to filter panel dropdowns with backend endpoints
This commit is contained in:
@@ -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 ──────────────────────────────────────────────
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user