From 5a954ecdaefc68564987a6d2d3b8637d8e652b5f Mon Sep 17 00:00:00 2001 From: 2000-Trek Date: Wed, 21 Jun 2023 20:44:12 +0200 Subject: [PATCH] api return fix --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 9be2943..2a99190 100644 --- a/main.py +++ b/main.py @@ -261,21 +261,21 @@ def get_id(): finished = queue_item return make_response(json.dumps({"mode":"0","error":"170"})) else: - c.execute(f"INSERT OR IGNORE INTO tags (tagid, userid) VALUES ({tag_id}, {user})") + c.execute(f"INSERT OR IGNORE INTO tags (tagid, userid) VALUES ({tag_id}, {user[1]})") message = tag_id finished = queue_item - c.execute(f"SELECT * FROM users WHERE id={user}") + c.execute(f"SELECT * FROM users WHERE id={user[1]}") username = c.fetchall() conn.commit() return make_response(json.dumps({"mode":"2","username":username,"code":"1"})) elif state == "remove": - c.execute(f"SELECT * FROM tags WHERE (tagid = {tag_id} AND userid = {user})") + c.execute(f"SELECT * FROM tags WHERE (tagid = {tag_id} AND userid = {user[1]})") tags = c.fetchall() if tags != []: - c.execute(f"DELETE FROM tags WHERE (tagid = {tag_id} AND userid = {user}) ") + c.execute(f"DELETE FROM tags WHERE (tagid = {tag_id} AND userid = {user[1]}) ") message = tag_id finished = queue_item - c.execute(f"SELECT * FROM users WHERE id={user}") + c.execute(f"SELECT * FROM users WHERE id={user[1]}") username = c.fetchall() conn.commit() return make_response(json({"mode":"2","username":username,"code":"2"}))