Fix single checkin GET to include username via JOIN

This commit is contained in:
2026-06-01 00:27:29 -04:00
parent e325981b17
commit 2d232941da
+1 -1
View File
@@ -1584,7 +1584,7 @@ def list_checkins(
@app.get("/api/checkins/{checkin_id}")
def get_checkin(checkin_id: int):
conn = get_db()
row = conn.execute("SELECT * FROM checkins WHERE id = ?", (checkin_id,)).fetchone()
row = conn.execute("SELECT c.*, u.username FROM checkins c LEFT JOIN users u ON c.user_id = u.id WHERE c.id = ?", (checkin_id,)).fetchone()
if row is None:
conn.close()
raise HTTPException(status_code=404, detail="Checkin not found")