Skip to content

Commit

Permalink
Update response for /v1/subscriptions/<wallet> to include keys in JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
freQniK committed Nov 28, 2023
1 parent 5c209af commit 79471a2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions meile_plan_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,18 @@ def get_current_subscriber(walletAddress):

c = GetDBCursor()
c.execute(query)


rows = c.fetchall()
columns = [desc[0] for desc in c.description]
result = []
for row in rows:
row = dict(zip(columns, row))
result.append(row)

try:
return Response(jsonify(data=c.fetchall()), status=200, mimetype='application/json')
except:
return jsonify(result)
except Exception as e:
print(str(e))
abort(404)

def UpdateMeileSubscriberDB():
Expand Down

0 comments on commit 79471a2

Please sign in to comment.