lokesh341 commited on
Commit
dcd7274
·
verified ·
1 Parent(s): f1d98a5

Update customdish.py

Browse files
Files changed (1) hide show
  1. customdish.py +6 -6
customdish.py CHANGED
@@ -31,7 +31,7 @@ def generate_custom_dish():
31
  "both"
32
 
33
  # Query to check if the dish already exists in Salesforce (Custom_Dish__c object)
34
- existing_dish_query = f"SELECT Id, Name, Price__c, Image1__c, Image2__c, Description__c, Veg_NonVeg__c ,Ingredients_List__c FROM Custom_Dish__c WHERE Name = '{dish_name}'"
35
  existing_dish_result = sf.query(existing_dish_query)
36
 
37
  if existing_dish_result['totalSize'] > 0:
@@ -52,7 +52,8 @@ def generate_custom_dish():
52
  'Veg_NonVeg__c': category,
53
  'Section__c': 'Customized dish',
54
  'Total_Ordered__c': 0,
55
- 'Ingredients_List__c':'Ingredients List'
 
56
  }
57
 
58
  # Insert the custom dish into Salesforce (Custom_Dish__c object)
@@ -92,7 +93,8 @@ def generate_custom_dish():
92
  'Quantity__c': 1, # Default quantity is 1
93
  'Add_Ons__c': '', # Set Add_ons__c to empty
94
  'Add_Ons_Price__c': 0, # Set Add_ons_Price__c to 0
95
- 'Customer_Email__c': email # Associate the custom dish with the logged-in user
 
96
  }
97
 
98
  # Insert the custom dish as a Cart_Item__c record in Salesforce
@@ -103,6 +105,4 @@ def generate_custom_dish():
103
 
104
 
105
  except Exception as e:
106
- return jsonify({"success": False, "error": str(e)}), 500
107
-
108
-
 
31
  "both"
32
 
33
  # Query to check if the dish already exists in Salesforce (Custom_Dish__c object)
34
+ existing_dish_query = f"SELECT Id, Name, Price__c, Image1__c, Image2__c, Description__c, Veg_NonVeg__c ,Ingredients_List__c, Sector_Detail__c FROM Custom_Dish__c WHERE Name = '{dish_name}'"
35
  existing_dish_result = sf.query(existing_dish_query)
36
 
37
  if existing_dish_result['totalSize'] > 0:
 
52
  'Veg_NonVeg__c': category,
53
  'Section__c': 'Customized dish',
54
  'Total_Ordered__c': 0,
55
+ 'Ingredients_List__c':'Ingredients List',
56
+ 'Sector_Detail__c': 'Custom' # Added Sector_Detail__c field
57
  }
58
 
59
  # Insert the custom dish into Salesforce (Custom_Dish__c object)
 
93
  'Quantity__c': 1, # Default quantity is 1
94
  'Add_Ons__c': '', # Set Add_ons__c to empty
95
  'Add_Ons_Price__c': 0, # Set Add_ons_Price__c to 0
96
+ 'Customer_Email__c': email, # Associate the custom dish with the logged-in user
97
+ 'Sector_Detail__c': 'Custom' # Added Sector_Detail__c field
98
  }
99
 
100
  # Insert the custom dish as a Cart_Item__c record in Salesforce
 
105
 
106
 
107
  except Exception as e:
108
+ return jsonify({"success": False, "error": str(e)}), 500