fix: explicit row serialization — sqlor rows are objects, not dicts
This commit is contained in:
parent
3a5b9068d9
commit
2438ea6174
@ -12,4 +12,7 @@ async with get_sor_context(env, "tenant") as sor:
|
||||
recs = await sor.sqlExe("SELECT count(*) as total FROM tenant_domain", {})
|
||||
total = recs[0].total if recs else 0
|
||||
recs = await sor.sqlExe("SELECT * FROM tenant_domain ORDER BY created_at desc LIMIT ${pagerows}$ OFFSET ${offset}$", ns)
|
||||
return {"total": total, "rows": [dict(r) for r in recs]}
|
||||
rows = []
|
||||
for r in recs:
|
||||
rows.append({"id": r.id, "domain": r.domain, "resellerid": r.resellerid, "orgid": r.orgid, "status": r.status, "created_at": str(r.created_at), "updated_at": str(r.updated_at)})
|
||||
return {"total": total, "rows": rows}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user