Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -167,14 +167,13 @@ def generate_custom_dish():
|
|
| 167 |
@app.route("/customer_details", methods=["GET"])
|
| 168 |
def customer_details():
|
| 169 |
email = session.get('user_email') # Get logged-in user's email
|
| 170 |
-
|
| 171 |
if not email:
|
| 172 |
return redirect(url_for("login"))
|
| 173 |
|
| 174 |
try:
|
| 175 |
# Fetch customer details from Salesforce based on the email
|
| 176 |
customer_record = sf.query(f"""
|
| 177 |
-
SELECT Name, Email__c, Phone_Number__c, Referral__c, Reward_Points__c
|
| 178 |
FROM Customer_Login__c
|
| 179 |
WHERE Email__c = '{email}'
|
| 180 |
LIMIT 1
|
|
@@ -248,9 +247,7 @@ def update_profile():
|
|
| 248 |
})
|
| 249 |
|
| 250 |
except Exception as e:
|
| 251 |
-
# This will catch any exceptions that occur and return the error message
|
| 252 |
return jsonify({'status': 'error', 'message': f'Error: {str(e)}'})
|
| 253 |
-
|
| 254 |
|
| 255 |
@app.route("/order-history", methods=["GET"])
|
| 256 |
def order_history():
|
|
|
|
| 167 |
@app.route("/customer_details", methods=["GET"])
|
| 168 |
def customer_details():
|
| 169 |
email = session.get('user_email') # Get logged-in user's email
|
|
|
|
| 170 |
if not email:
|
| 171 |
return redirect(url_for("login"))
|
| 172 |
|
| 173 |
try:
|
| 174 |
# Fetch customer details from Salesforce based on the email
|
| 175 |
customer_record = sf.query(f"""
|
| 176 |
+
SELECT Id, Name, Email__c, Phone_Number__c, Referral__c, Reward_Points__c
|
| 177 |
FROM Customer_Login__c
|
| 178 |
WHERE Email__c = '{email}'
|
| 179 |
LIMIT 1
|
|
|
|
| 247 |
})
|
| 248 |
|
| 249 |
except Exception as e:
|
|
|
|
| 250 |
return jsonify({'status': 'error', 'message': f'Error: {str(e)}'})
|
|
|
|
| 251 |
|
| 252 |
@app.route("/order-history", methods=["GET"])
|
| 253 |
def order_history():
|