Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -219,9 +219,11 @@ def get_order_history():
|
|
219 |
|
220 |
query = f"SELECT Id, Order_Date__c, Status__c, Total_Amount__c FROM Order_History__c WHERE Customer__c = '{customer_id}'"
|
221 |
result = sf.query(query)
|
|
|
|
|
222 |
order_history = [{"order_id": item['Id'], "date": item['Order_Date__c'], "status": item['Status__c'], "total": item['Total_Amount__c']} for item in result['records']]
|
223 |
|
224 |
-
|
225 |
return jsonify({"success": True, "order_history": order_history})
|
226 |
|
227 |
except Exception as e:
|
|
|
219 |
|
220 |
query = f"SELECT Id, Order_Date__c, Status__c, Total_Amount__c FROM Order_History__c WHERE Customer__c = '{customer_id}'"
|
221 |
result = sf.query(query)
|
222 |
+
|
223 |
+
# Prepare order history data
|
224 |
order_history = [{"order_id": item['Id'], "date": item['Order_Date__c'], "status": item['Status__c'], "total": item['Total_Amount__c']} for item in result['records']]
|
225 |
|
226 |
+
# Return the order history as JSON
|
227 |
return jsonify({"success": True, "order_history": order_history})
|
228 |
|
229 |
except Exception as e:
|