1
0
Fork 0
forked from bton/matekasse

API return json

This commit is contained in:
2000-Trek 2023-06-21 19:07:02 +02:00
parent 6b21837789
commit d9b0fe5dde

View file

@ -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")