api fix
This commit is contained in:
parent
e78416efd0
commit
35cfedbb2e
1 changed files with 3 additions and 3 deletions
6
main.py
6
main.py
|
@ -187,7 +187,7 @@ def request_addtag(data):
|
||||||
finished = None
|
finished = None
|
||||||
c.execute(f"SELECT * FROM users WHERE id ={user[0]}")
|
c.execute(f"SELECT * FROM users WHERE id ={user[0]}")
|
||||||
username = c.fetchall()[0][1]
|
username = c.fetchall()[0][1]
|
||||||
if message == "Tag already exists":
|
if message == "Error: 170":
|
||||||
socketio.emit("finished", f"{message}")
|
socketio.emit("finished", f"{message}")
|
||||||
else:
|
else:
|
||||||
socketio.emit("finished", f"Added {message} to {username}", to=session[id])
|
socketio.emit("finished", f"Added {message} to {username}", to=session[id])
|
||||||
|
@ -265,7 +265,7 @@ def get_id():
|
||||||
message = tag_id
|
message = tag_id
|
||||||
finished = queue_item
|
finished = queue_item
|
||||||
c.execute(f"SELECT * FROM users WHERE id={user}")
|
c.execute(f"SELECT * FROM users WHERE id={user}")
|
||||||
username = c.fetchall()[0]
|
username = c.fetchall()[0][1]
|
||||||
conn.commit()
|
conn.commit()
|
||||||
return make_response(json.dumps({"mode":"2","username":username,"code":"1"}))
|
return make_response(json.dumps({"mode":"2","username":username,"code":"1"}))
|
||||||
elif state == "remove":
|
elif state == "remove":
|
||||||
|
@ -276,7 +276,7 @@ def get_id():
|
||||||
message = tag_id
|
message = tag_id
|
||||||
finished = queue_item
|
finished = queue_item
|
||||||
c.execute(f"SELECT * FROM users WHERE id={user}")
|
c.execute(f"SELECT * FROM users WHERE id={user}")
|
||||||
username = c.fetchall()[0]
|
username = c.fetchall()[0][1]
|
||||||
conn.commit()
|
conn.commit()
|
||||||
return make_response(json({"mode":"2","username":username,"code":"2"}))
|
return make_response(json({"mode":"2","username":username,"code":"2"}))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue