From d9b0fe5ddec3d0bfb6bd9d1c10f523ee08994d81 Mon Sep 17 00:00:00 2001 From: 2000-Trek Date: Wed, 21 Jun 2023 19:07:02 +0200 Subject: [PATCH] API return json --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index e36dd86..64c8f93 100644 --- a/main.py +++ b/main.py @@ -280,7 +280,7 @@ def get_id(): c.execute(f"UPDATE users SET balance = balance - 1 WHERE id={tag[1]}") conn.commit() c.execute(f"SELECT * FROM users WHERE id={tag[1]}") - user = c.fetchall() + user = c.fetchall()[0] socketio.emit("update", "update") return make_response(json.dumps({"username":user[1], "balance":user[2]})) socketio.emit("update", "update")