Browse Source

amended collect api

CJYen 3 years ago
parent
commit
0a32aa0163
1 changed files with 3 additions and 2 deletions
  1. 3 2
      main.py

+ 3 - 2
main.py

@@ -177,6 +177,7 @@ def collection(userid):
     nft = {}
     nfts_all = {}
     i = 0
+    j = 0
     if not table3.find_one(userid=userid) and not table2.find_one(userid=userid):
         db.close()
         return "error: user don't have any nft"
@@ -190,8 +191,8 @@ def collection(userid):
 
         results2 = table2.find(userid=userid)
         for item in results2:
-            nft[i] = item
-            i += 1
+            nft[j] = item
+            j += 1
 
         nfts_all[0] = nftdrops
         nfts_all[1] = nft