Parcourir la source

modify json format

ming il y a 3 ans
Parent
commit
16086d8f28
1 fichiers modifiés avec 2 ajouts et 4 suppressions
  1. 2 4
      app/api/api_v1/endpoints/line.py

+ 2 - 4
app/api/api_v1/endpoints/line.py

@@ -410,11 +410,9 @@ def transactions(userid,skip: int = 0, limit: int = 100):
     sql = 'SELECT * FROM transaction  ' \
           'WHERE tfrom="'+userid+'" limit '+str(skip)+', '+str(limit)
     result = db.query(sql)
-    rows = {}
-    i = 0
+    rows = []
     for row in result:
-        rows[i] = row
-        i += 1
+        rows.append(row)
     db.close()
     
     return rows