forked from bton/matekasse
API return json
This commit is contained in:
parent
6b21837789
commit
d9b0fe5dde
1 changed files with 1 additions and 1 deletions
2
main.py
2
main.py
|
@ -280,7 +280,7 @@ def get_id():
|
||||||
c.execute(f"UPDATE users SET balance = balance - 1 WHERE id={tag[1]}")
|
c.execute(f"UPDATE users SET balance = balance - 1 WHERE id={tag[1]}")
|
||||||
conn.commit()
|
conn.commit()
|
||||||
c.execute(f"SELECT * FROM users WHERE id={tag[1]}")
|
c.execute(f"SELECT * FROM users WHERE id={tag[1]}")
|
||||||
user = c.fetchall()
|
user = c.fetchall()[0]
|
||||||
socketio.emit("update", "update")
|
socketio.emit("update", "update")
|
||||||
return make_response(json.dumps({"username":user[1], "balance":user[2]}))
|
return make_response(json.dumps({"username":user[1], "balance":user[2]}))
|
||||||
socketio.emit("update", "update")
|
socketio.emit("update", "update")
|
||||||
|
|
Loading…
Reference in a new issue