Yaswanth56 commited on
Commit
2b538a7
·
verified ·
1 Parent(s): 2e71cef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -38,12 +38,12 @@ def get_ingredients():
38
  dietary_preference = request.json.get('dietary_preference', '').strip().lower()
39
  logging.debug(f"Received dietary preference: {dietary_preference}")
40
 
41
- if dietary_preference == 'vegetable':
42
- logging.debug("Fetching ingredients for Vegetables...")
43
- soql = "SELECT Name, Image_URL__c FROM Sector_Detail__c WHERE Category__c = 'Veg' LIMIT 200"
44
- elif dietary_preference == 'Non-Vegetarian':
45
- logging.debug(f"Fetching ingredients for Non-Vegetarian...")
46
- soql = "SELECT Name, Image_URL__c FROM Sector_Detail__c WHERE Category__c = 'Non-Veg' LIMIT 200"
47
  else:
48
  logging.debug("Invalid dietary preference received.")
49
  return jsonify({"error": "Invalid dietary preference."}), 400
 
38
  dietary_preference = request.json.get('dietary_preference', '').strip().lower()
39
  logging.debug(f"Received dietary preference: {dietary_preference}")
40
 
41
+ if dietary_preference == 'veg':
42
+ print("Fetching ingredients for Vegetarian...") # Debug when fetching vegetarian ingredients
43
+ soql = "SELECT Name, Image_URL__c FROM Sector_Detail__c WHERE Category__c IN ('Veg') LIMIT 200"
44
+ elif dietary_preference == 'non-vegetarian':
45
+ print("Fetching ingredients for Non-Vegetarian...") # Debug when fetching non-vegetarian ingredients
46
+ soql = "SELECT Name, Image_URL__c FROM Sector_Detail__c WHERE Category__c IN ('Non-Veg') LIMIT 200"
47
  else:
48
  logging.debug("Invalid dietary preference received.")
49
  return jsonify({"error": "Invalid dietary preference."}), 400