fix: sessions API — нет колонки title, используем vin/car_info

This commit is contained in:
Repinoid
2026-06-08 11:48:14 +04:00
parent e5bc77ec15
commit 31cba53798
+3 -3
View File
@@ -248,13 +248,13 @@ def register(app):
return _auth_error()
with Database() as db:
rows = db.conn.execute(
"SELECT id, title, created_at, uploaded, diagnosis FROM sessions ORDER BY id DESC LIMIT 50"
"SELECT id, vin, car_info, created_at, diagnosis_text as diagnosis FROM sessions ORDER BY id DESC LIMIT 50"
).fetchall()
return jsonify([{
"id": r["id"],
"title": r["title"] or "Диагностика",
"title": (r["vin"] or r["car_info"] or "Диагностика"),
"created_at": r["created_at"],
"uploaded": r["uploaded"],
"uploaded": 1,
"diagnosis": r["diagnosis"] or ""
} for r in rows])