nagasurendra commited on
Commit
18dc44c
·
verified ·
1 Parent(s): 8ac08a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -277,15 +277,15 @@ def update_quantity():
277
  return jsonify({"success": False, "error": "Email and item name are required."}), 400
278
 
279
  try:
280
- # Query the cart item using the correct field names
281
  cart_items = sf.query(
282
- f"SELECT Id, Quantity__c FROM Cart_Item__c WHERE Customer_Email__c = '{email}' AND Name__c = '{item_name}'"
283
  )['records']
284
 
285
  if not cart_items:
286
  return jsonify({"success": False, "error": "Cart item not found."}), 404
287
 
288
- # Get the first matching record ID
289
  cart_item_id = cart_items[0]['Id']
290
 
291
  # Update the quantity in Salesforce
 
277
  return jsonify({"success": False, "error": "Email and item name are required."}), 400
278
 
279
  try:
280
+ # Query the cart item using the correct fields
281
  cart_items = sf.query(
282
+ f"SELECT Id, Quantity__c FROM Cart_Item__c WHERE Customer_Email__c = '{email}' AND Name = '{item_name}'"
283
  )['records']
284
 
285
  if not cart_items:
286
  return jsonify({"success": False, "error": "Cart item not found."}), 404
287
 
288
+ # Get the first matching record ID (assuming the item name is unique per user)
289
  cart_item_id = cart_items[0]['Id']
290
 
291
  # Update the quantity in Salesforce