added dash call

This commit is contained in:
CHIEFSOFT\ameye
2024-12-11 12:02:40 -05:00
parent e425146e72
commit 6ee800a344
3 changed files with 28 additions and 17 deletions
+13 -14
View File
@@ -118,17 +118,6 @@ def start_login():
"error": "Unauthorized"
}, 404
# GLOBAL_AVG = """SELECT * FROM members WHERE id = 1;"""
# with connection:
# with connection.cursor() as cursor:
# cursor.execute(GLOBAL_AVG)
# account = cursor.fetchone()
# #return jsonify(hello="ameye world")
# token = jwt.encode({'user': 'account', 'exp' : datetime.datetime.utcnow() + datetime.timedelta(minutes=30)},app.config['SECRET_KEY'] )
# # return {"account": account}
# return {"token": token}
except Exception as e:
return {
"message": "Something went wrong!",
@@ -151,14 +140,24 @@ def start_resetpass():
@app.route("/panel/account")
@token_required
def panel_account(current_user):
member_dash = Members().get_member_by_uid(current_user.user.uid)
print(member_dash)
# print(current_user["user"]["uid"])
user_uid = current_user["user"]["uid"]
# print(user_uid)
member_dash = Members().get_member_by_uid(user_uid)
print(member_dash[0])
print(member_dash[0][0])
return jsonify(hello=current_user)
@app.route("/panel/account/dash")
@token_required
def dashboard():
return jsonify(hello="ameye world")
dash_data = {
"username": "sanyaameye",
"account_name": "This is the test account name",
"firstname": "TestFirstname",
"lastname": "TestLastname"
}
return jsonify(dash_data=dash_data)
@app.route("/panel/account/products")
@token_required